Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Stefan Dirix <[email protected]>
  • Loading branch information
LukasBoll and sdirix authored Apr 15, 2024
1 parent 99d4152 commit d2d24bc
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions content/docs/tutorial/dynamic-enum.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const url = schema['x-url'];
#### Initializing the React Context

Now that we have access to the API URL, we can use React Context to make this data available across our renderers.
React Context allows you to share data globally within your application, enabling components deep in the component tree to access data without needing to pass properties through all parent elements.
React Context allows you to share data deep in the component tree to access data without needing to pass additional properties through the component hierarchy.
To set up the React Context for your API service, create it in your application as follows:

```js
Expand All @@ -90,7 +90,7 @@ Access the API service using the context:
const api = React.useContext(APIContext);
```

Changing the context's value will trigger a re-render of components that use it, making it a powerful tool for managing dynamic data.
Changing the context's value will trigger a re-render of components that use it.


### The Country Renderer
Expand Down Expand Up @@ -157,7 +157,7 @@ type JsonSchemaWithDependenciesAndEndpoint = JsonSchema & {
endpoint: string;
};

export const Country = (
const CountryControl = (
props: ControlProps & OwnPropsOfEnum & WithOptionLabel & TranslateProps
) => {
const { handleChange } = props;
Expand Down Expand Up @@ -255,5 +255,4 @@ export const Region = (
);
};
```
Again we need to create a [create a tester](./custom-renderers#2-create-a-tester) and [register](./custom-renderers#3-register-the-renderer) the new custom renderer.
A running example of the scenario can also be seen at the [react-seed](https://github.com/eclipsesource/jsonforms-react-seed) app.
Again we need to create a [create a tester](./custom-renderers#2-create-a-tester) and [register](./custom-renderers#3-register-the-renderer) the new custom renderer.

0 comments on commit d2d24bc

Please sign in to comment.