rsnext/examples/with-mobx-state-tree/pages/_app.tsx
Henrik Wenz 2b9268a911
[Docs] Merge with-mobx-state-tree with with-mobx-state-tree-typescript example (#40306)
## Changes

see commits

## Context

As discussed in https://github.com/vercel/next.js/pull/40302#issuecomment-1239238966 we are going to merge the mobx examples.

#40302

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm lint`
- [x] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-09-08 12:56:12 +00:00

12 lines
278 B
TypeScript

import { Provider } from 'mobx-react'
import { useStore } from '../store'
export default function App({ Component, pageProps }) {
const store = useStore(pageProps.initialState)
return (
<Provider store={store}>
<Component {...pageProps} />
</Provider>
)
}