Skip to content

Commit

Permalink
Fix initial state (alibaba#509)
Browse files Browse the repository at this point in the history
  • Loading branch information
janryWang authored Dec 16, 2019
1 parent 06c4f63 commit b2e1936
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,11 +402,21 @@ export function createForm<FieldProps, VirtualFieldProps>(
if (isValid(display)) {
state.display = display
}
state.props = props
state.required = required
state.rules = rules as any
state.selfEditable = editable
state.formEditable = options.editable
if (isValid(props)) {
state.props = props
}
if (isValid(required)) {
state.required = required
}
if (isValid(rules)) {
state.rules = rules
}
if (isValid(editable)) {
state.selfEditable = editable
}
if (isValid(options.editable)) {
state.formEditable = options.editable
}
state.initialized = true
})
batchRunTaskQueue(field, nodePath)
Expand Down

0 comments on commit b2e1936

Please sign in to comment.