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 documentation typo #1456

Merged
merged 1 commit into from
Apr 11, 2024
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
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>
Loading