Skip to content

Commit

Permalink
docs: add rootContainer eg
Browse files Browse the repository at this point in the history
  • Loading branch information
hualigushi committed Nov 27, 2024
1 parent 1a7827a commit e3ac8b5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
14 changes: 13 additions & 1 deletion docs/docs/docs/api/runtime-config.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,19 @@ Modify the root component handed over to react-dom for rendering.
For example, to wrap a Provider around the outside,
```js
e.g.
```jsx
export function rootContainer(container, args) {
return (
<ThemeProvider>
{container}
</ThemeProvider>
);
}
```
e.g.
```jsx
export function rootContainer(container, args) {
return React.createElement(ThemeProvider, null, container);
}
Expand Down
13 changes: 12 additions & 1 deletion docs/docs/docs/api/runtime-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,18 @@ export function render(oldRender) {
比如用于在外面包一个 Provider,
```js
e.g.
```jsx
export function rootContainer(container, args) {
return (
<ThemeProvider>
{container}
</ThemeProvider>
);
}
```
e.g.
```jsx
export function rootContainer(container, args) {
return React.createElement(ThemeProvider, null, container);
}
Expand Down

0 comments on commit e3ac8b5

Please sign in to comment.