Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pauleveritt/eleventy-jsx-async-runtime

Example of Preact, render, and context for a ticket in jsx-async-runtime.
https://github.com/pauleveritt/eleventy-jsx-async-runtime

Last synced: about 4 hours ago
JSON representation

Example of Preact, render, and context for a ticket in jsx-async-runtime.

Awesome Lists containing this project

README

        

# 11ty and jsx-async-runtime

Explain [a ticket in the jsx-async-runtime](https://github.com/jeasx/jsx-async-runtime/issues/1#issuecomment-2202170527)
repo about subcomponents and binding to `this`.

We'd like to avoid prop drilling to subcomponents by allowing `this` to have access to render `data`. Preact can do this
with an extra arg to `render`. This arg becomes `this.context` in all components and subcomponents.

[Demonstration video on YouTube](https://youtu.be/3y1-tuk2Z9E)

## Summary

1. Run `npm run build` (or start).

2. Look in `_site/index.html` at the `title` on the `

`.

3. It comes from `_includes/Heading.tsx` which has a comment explaining how it works.