Skip to content

docs: Add preact-root-fragment#1342

Merged
rschristian merged 1 commit intomasterfrom
docs/preact-root-fragment
Sep 30, 2025
Merged

docs: Add preact-root-fragment#1342
rschristian merged 1 commit intomasterfrom
docs/preact-root-fragment

Conversation

@rschristian
Copy link
Member

This was on my todo list and evidently completely slipped my mind when publishing preact-root-fragment, whoops.

Comment on lines +72 to +85
The first argument must be a valid Virtual DOM Element, which represents either a component or an element. When passing a Component, it's important to let Preact do the instantiation rather than invoking your component directly, which will break in unexpected ways:

```jsx
const App = () => <div>foo</div>;

// DON'T: Invoking components directly means they won't be counted as a
// VNode and hence not be able to use functionality relating to vnodes.
render(App(), rootElement); // ERROR
render(App, rootElement); // ERROR

// DO: Passing components using h() or JSX allows Preact to render correctly:
render(h(App), rootElement); // success
render(<App />, rootElement); // success
```
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Little switch-er-roo on the sections here, I feel that this is something a lot of folks run into and should be higher up than the instructions on replaceNode

@@ -0,0 +1,102 @@
---
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly copy/pasted from preact-root-fragement's README.md

Comment on lines +474 to +481
},
{
"name": {
"en": "Libraries",
"ru": "Библиотеки",
"zh": "库"
},
"routes": [
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was an oversight, we are missing sidebar entries for these libraries in v11

@rschristian rschristian merged commit 62f8cd8 into master Sep 30, 2025
5 checks passed
@rschristian rschristian deleted the docs/preact-root-fragment branch September 30, 2025 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants