By default, the export package name for all APIs in this section is: @modern-js/runtime/model
.
If Reduck is integrated separately from Modern.js, the export package name is: @modern-js-reduck/react
.
To use the State in the Model as a local state, the effect is similar to React's useState
. useLocalModel
API same as useModel
. For detail, see useModel
.
modelA
was loaded twice with useLocalModel above, because useLocalModel consumes local state, so state and state1 are also completely isolated.