mobx-react-use-autorun 3.0.59 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Provide concise usage to facilitate the use of mobx in react
|
|
1
|
+
Provide concise usage for mobx in react<br/>
|
|
3
2
|
|
|
4
3
|
# `Installation`
|
|
5
4
|
|
|
@@ -34,7 +33,6 @@ Form validation<br/>
|
|
|
34
33
|
|
|
35
34
|
import { Button, TextField } from '@mui/material';
|
|
36
35
|
import { observer, useMobxState } from 'mobx-react-use-autorun';
|
|
37
|
-
import { MessageService } from '../../common/MessageService';
|
|
38
36
|
|
|
39
37
|
export default observer(() => {
|
|
40
38
|
|
|
@@ -58,9 +56,9 @@ Form validation<br/>
|
|
|
58
56
|
async function ok(){
|
|
59
57
|
state.submit = true;
|
|
60
58
|
if (state.errors.hasError()) {
|
|
61
|
-
|
|
59
|
+
console.log("Submission Failed");
|
|
62
60
|
} else {
|
|
63
|
-
|
|
61
|
+
console.log("Submitted successfully");
|
|
64
62
|
}
|
|
65
63
|
}
|
|
66
64
|
|
|
@@ -132,7 +130,8 @@ Provide a method to generate state, the state is executed only once, and the per
|
|
|
132
130
|
|
|
133
131
|
### Notes - Get the real data of the proxy object with toJS
|
|
134
132
|
|
|
135
|
-
toJS will cause data to be used, please do not execute toJS(state) in component rendering code, it may cause repeated rendering
|
|
133
|
+
toJS will cause data to be used, please do not execute toJS(state) in component rendering code, it may cause repeated rendering.<br/>
|
|
134
|
+
Wrong Usage Demonstration:<br/>
|
|
136
135
|
|
|
137
136
|
import { toJS, observer, useMobxState } from 'mobx-react-use-autorun'
|
|
138
137
|
import { v1 } from 'uuid'
|
|
@@ -148,7 +147,8 @@ toJS will cause data to be used, please do not execute toJS(state) in component
|
|
|
148
147
|
return null;
|
|
149
148
|
})
|
|
150
149
|
|
|
151
|
-
Other than that, all usages are correct
|
|
150
|
+
Other than that, all usages are correct.<br/>
|
|
151
|
+
Correct Example:<br/>
|
|
152
152
|
|
|
153
153
|
import { toJS, useMobxEffect } from 'mobx-react-use-autorun';
|
|
154
154
|
import { observer, useMobxState } from 'mobx-react-use-autorun';
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"mobx-react-use-autorun","version":"3.0
|
|
1
|
+
{"name":"mobx-react-use-autorun","version":"3.1.0","description":"React Hook for mobx","scripts":{"test":"npx -y -p typescript -p ts-node ts-node --skipProject bin/mobx_react_test.ts","build":"npx -y -p typescript -p ts-node ts-node --skipProject bin/mobx_react_build.ts","make":"npx -y -p typescript -p ts-node ts-node --skipProject bin/mobx_react_make.ts"},"dependencies":{"mobx":"6.7.0","mobx-react-lite":"3.4.0","react-use":"17.4.0","rxjs":"7.8.0"},"peerDependencies":{"react":">=16.8.0"},"license":"MIT","keywords":["react","mobx","typescript"],"main":"./dist/index.js","types":"./dist/index.d.ts","eslintConfig":{"extends":["react-app","react-app/jest"]},"homepage":"https://github.com/zdu-strong/mobx-react-use-autorun#readme","repository":{"type":"git","url":"git+https://github.com/zdu-strong/mobx-react-use-autorun.git"},"files":["lib","dist"],"bugs":{"url":"https://github.com/zdu-strong/mobx-react-use-autorun/issues"},"publishConfig":{"registry":"https://registry.npmjs.org/"}}
|