Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove react unstable concurrent #270

Merged
merged 5 commits into from
Aug 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions docs/Examples/antd/Actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ import 'antd/dist/antd.css'

const actions = createFormActions()

actions.setFieldState('aa', state => { //同步调用会出错
actions.setFieldState('aa', state => {
//同步调用会出错
state.value = '123'
})
actions.submit() //同步调用会出错
Expand All @@ -48,24 +49,23 @@ const App = () => (
>
<Field name="aa" type="string" required title="AA" />
<FormButtonGroup offset={6}>
<Button onClick={()=>{
<Button
onClick={() => {
//异步调用没问题
actions.setFieldState('aa', state => {
state.value = 'hello world'
})
actions.submit()
}}>修改AA的值并提交表单</Button>
}}
>
修改AA的值并提交表单
</Button>
</FormButtonGroup>
</SchemaForm>
</Printer>
)
console.log(React.unstable_ConcurrentMode)
ReactDOM.render(
<React.unstable_ConcurrentMode>
<App />
</React.unstable_ConcurrentMode>,
document.getElementById('root')
)

ReactDOM.render(<App />, document.getElementById('root'))
```

### 使用 createAsyncFormActions 做通讯
Expand Down
20 changes: 10 additions & 10 deletions docs/Examples/next/Actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ import '@alifd/next/dist/next.css'

const actions = createFormActions()

actions.setFieldState('aa', state => { //同步调用会出错
actions.setFieldState('aa', state => {
//同步调用会出错
state.value = '123'
})
actions.submit() //同步调用会出错
Expand All @@ -48,24 +49,23 @@ const App = () => (
>
<Field name="aa" type="string" required title="AA" />
<FormButtonGroup offset={6}>
<Button onClick={()=>{
<Button
onClick={() => {
//异步调用没问题
actions.setFieldState('aa', state => {
state.value = 'hello world'
})
actions.submit()
}}>修改AA的值并提交表单</Button>
}}
>
修改AA的值并提交表单
</Button>
</FormButtonGroup>
</SchemaForm>
</Printer>
)
console.log(React.unstable_ConcurrentMode)
ReactDOM.render(
<React.unstable_ConcurrentMode>
<App />
</React.unstable_ConcurrentMode>,
document.getElementById('root')
)

ReactDOM.render(<App />, document.getElementById('root'))
```

### 使用 createAsyncFormActions 做通讯
Expand Down