Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
fix: hydration warning in with-mobx-state-tree-typescript example (ve…
Browse files Browse the repository at this point in the history
…rcel#27339)

## Bug

- [x] Related issues linked using `fixes #number` fixes vercel#27290
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [x] Make sure the linting passes
  • Loading branch information
ThangHuuVu authored Jul 20, 2021
1 parent 38e85b4 commit 4e98cdc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface IOwnProps {
}

const SampleComponent: React.FC<IOwnProps> = observer((props) => {
const { lastUpdate, light, start, stop } = useStore('')
const { lastUpdate, light, start, stop } = useStore(props.store)

useEffect(() => {
start()
Expand Down
1 change: 1 addition & 0 deletions examples/with-mobx-state-tree-typescript/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />
4 changes: 2 additions & 2 deletions examples/with-mobx-state-tree-typescript/pages/ssg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { getSnapshot } from 'mobx-state-tree'
import SampleComponent from '../components/SampleComponent'
import { initializeStore } from '../store'

export default function Ssg() {
return <SampleComponent title={'SSG Page'} linkTo="/" />
export default function Ssg({ initialState }) {
return <SampleComponent title={'SSG Page'} linkTo="/" store={initialState} />
}

// If you build and start the app, the date returned here will have the same
Expand Down
4 changes: 2 additions & 2 deletions examples/with-mobx-state-tree-typescript/pages/ssr.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { getSnapshot } from 'mobx-state-tree'
import SampleComponent from '../components/SampleComponent'
import { initializeStore } from '../store'

export default function Ssr() {
return <SampleComponent title={'SSR Page'} linkTo="/" />
export default function Ssr({ initialState }) {
return <SampleComponent title={'SSR Page'} linkTo="/" store={initialState} />
}

// The date returned here will be different for every request that hits the page,
Expand Down

0 comments on commit 4e98cdc

Please sign in to comment.