Skip to content

Commit f7eb988

Browse files
Add basic migration docs to changelog (#220)
* Add basic migration docs to changelog * Add props argument to docs * Self review
1 parent 0178da9 commit f7eb988

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,30 @@
66
- feature: Re-implement <Parcel /> component 15d55b1 ([#218](https://github.com/single-spa/single-spa-react/pull/218)) by Jolyn
77
- breaking: Remove main, module, and require fields from package.json 15d55b1 ([#218](https://github.com/single-spa/single-spa-react/pull/218)) by Jolyn
88
- breaking: Rewrite to typescript. New opts required. Newer versions of React required 15d55b1 ([#218](https://github.com/single-spa/single-spa-react/pull/218)) by Jolyn
9+
- breaking: returns `init` function rather than `bootstrap` function, which is compatible with single-spa@7 or with earlier versions of single-spa via the [`@single-spa/lifecycles-compat`](https://github.com/single-spa/lifecyles-compat) library
10+
11+
### Upgrading
12+
13+
```diff
14+
-export const { bootstrap, mount, unmount } = singleSpaReact({
15+
- React,
16+
- ReactDOMClient,
17+
- rootComponent,
18+
- errorBoundary(err, info, props) {
19+
- // https://reactjs.org/docs/error-boundaries.html
20+
- return <div>This renders when a catastrophic error occurs</div>;
21+
- },
22+
-});
23+
24+
+export const { init, mount, unmount } = singleSpaReact({
25+
+ createRoot,
26+
+ createElement,
27+
+ useEffect,
28+
+ renderReactNode: (props) => (
29+
+ <Root />
30+
+ )
31+
+});
32+
```
933

1034
## 6.0.2
1135

0 commit comments

Comments
 (0)