Context API & Redux
React Context API
If you're using the new React Context API then you can access the context in the components used within the grid.
First, let's create a context we can use in our components:
Next we need to provide the context in a parent component (at the Grid level, or above) - for example:
Finally, we need to consume the context within our component:
Redux / Higher Order Components (HOC)
If you use connect to use Redux, or if you're using a Higher Order Component (HOC) to wrap the grid React component at all,
you'll also need to ensure the grid can get access to the newly created component. To do this you need to ensure forwardRef
is set: