Skip to content

Commit

Permalink
fix: update head manager
Browse files Browse the repository at this point in the history
- add note about wrapping outlet into suspense
  • Loading branch information
MatthewPattell committed Jan 11, 2024
1 parent 6030a14 commit e0a65cc
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 46 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,29 @@ __NOTE: see .github for understand CI/CD__
2. Create Pull Request & test
3. Squash & merge into `prod`

## WARNING
Right solution for wrap `<Outlet />` into `<Suspense />`. If you would like to wrap your lazy routes only once:
```typescript jsx
import { Outlet, useLocation } from 'react-router-dom';
import type { FCRoute } from '@lomray/vite-ssr-boost/interfaces/fc-route';
import { Suspense } from '@lomray/consistent-suspense';

/**
* NOTE: without key it's doesn't work
* @see https://github.com/remix-run/react-router/issues/10568
* @constructor
*/
const MyLayout: FCRoute = () => {
const { key } = useLocation();

return (
<Suspense key={key}>
<Outlet/>
</Suspense>
)
}
```

## Docker build
[See github workflow](.github/workflows/release.yml) or
```bash
Expand Down
78 changes: 33 additions & 45 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"dependencies": {
"@lomray/consistent-suspense": "^2.0.1",
"@lomray/react-head-manager": "^1.1.1",
"@lomray/react-head-manager": "^2.0.1",
"@lomray/react-mobx-manager": "^3.0.0",
"@lomray/react-route-manager": "^1.2.1",
"@lomray/vite-ssr-boost": "^2.0.3",
Expand Down

0 comments on commit e0a65cc

Please sign in to comment.