Skip to content

Commit

Permalink
Fix documentation typo
Browse files Browse the repository at this point in the history
  • Loading branch information
rvsia committed Apr 11, 2024
1 parent 22fbc98 commit 6ff530c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const FieldListener = () => {
return null;
};

const FieldListenerWrapper = () => <FormSpy subcription={{ values: true }}>{() => <FieldListener />}</FormSpy>;
const FieldListenerWrapper = () => <FormSpy subscription={{ values: true }}>{() => <FieldListener />}</FormSpy>;

const schema = {
fields: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import CodeExample from '@docs/code-example';

<DocPage>


# Value listener

This example shows how to update a value of one field according to a value of others without using the set [condition](/schema/condition-set).
Expand All @@ -12,7 +11,7 @@ This example shows how to update a value of one field according to a value of ot

Basically you have to just a set up a new component, that will listen to the form state and updates the intended fields.

**FormSpy** with a correct subscription ensures that the component will be always updated. You can also set the [subcription](/components/renderer#subscription) on the form level in the form renderer.
**FormSpy** with a correct subscription ensures that the component will be always updated. You can also set the [subscription](/components/renderer#subscription) on the form level in the form renderer.

**hideField** ensures that the listener component is not visible in the dom and it won't affect the form layout.

Expand All @@ -26,4 +25,4 @@ Basically you have to just a set up a new component, that will listen to the for

<CodeExample source="components/examples/value-listener" mode="preview" />

</DocPage>
</DocPage>

0 comments on commit 6ff530c

Please sign in to comment.