Skip to content

Commit

Permalink
fix: remove react unstable concurrent (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
monkindey authored and janryWang committed Aug 19, 2019
1 parent ccc7b05 commit 4de5590
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
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

0 comments on commit 4de5590

Please sign in to comment.