Skip to content

Commit da8957a

Browse files
Migrate 'Integrating with MobX State Tree' to static API (#1311)
1 parent 9a62c1d commit da8957a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

versioned_docs/version-7.x/MST-integration.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ title: Integrating with MobX State Tree
44
sidebar_label: MobX State Tree integration
55
---
66

7+
import Tabs from '@theme/Tabs';
8+
import TabItem from '@theme/TabItem';
9+
710
:::note
811

912
This guide is incomplete. Please help improve this by sending pull requests.
@@ -32,12 +35,27 @@ At this point, you're probably wondering how to connect your MST objects with th
3235

3336
Use `Provider` to wrap what you return from your root component's render method:
3437

38+
<Tabs groupId="config" queryString="config">
39+
<TabItem value="static" label="Static" default>
40+
41+
```js
42+
<Provider myObject={this.myObject}>
43+
<Navigation />
44+
</Provider>
45+
```
46+
47+
</TabItem>
48+
<TabItem value="dynamic" label="Dynamic" default>
49+
3550
```js
3651
<Provider myObject={this.myObject}>
3752
<NavigationContainer>{/* Screen configuration */}</NavigationContainer>
3853
</Provider>
3954
```
4055

56+
</TabItem>
57+
</Tabs>
58+
4159
this will allow you to access `myObject` from any React component in the application through the `inject` function which can be quite useful.
4260

4361
Use `observer` function to wrap all components that render observable data. This will make sure the components re-render once the data they render changes.

0 commit comments

Comments
 (0)