Skip to content

Commit

Permalink
docs(react): improve ObjectField demo code (#1727)
Browse files Browse the repository at this point in the history
  • Loading branch information
satouriko authored Jul 7, 2021
1 parent c4cddc6 commit ccfba03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react/docs/api/components/ObjectField.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const ObjectComponent = observer(() => {
<Button
onClick={() => {
const name = form.values.propertyName
if (name && !form.existValuesIn(`object.${name}`)) {
if (name && !form.existValuesIn(`${field.path}.${name}`)) {
field.addProperty(name, '')
form.deleteValuesIn('propertyName')
}
Expand Down Expand Up @@ -132,7 +132,7 @@ export default () => (
<Button
onClick={() => {
const name = form.values.propertyName
if (name && !form.existValuesIn(`object.${name}`)) {
if (name && !form.existValuesIn(`${field.path}.${name}`)) {
field.addProperty(name, '')
form.deleteValuesIn('propertyName')
}
Expand Down

0 comments on commit ccfba03

Please sign in to comment.