Reputation: 33
Bit of a newbie here that recently moved to v4. I have some Resources declared using options to pass some custom property. In React Admin 3 syntax:
<Resource name='mydata' options={{label: "Mylabel", site: site}} list={MyList} />
This is using the options prop to pass down my site property. Since the props injection is removed in React admin V4 - what is a good way to pass this prop to my list component in V4?
Upvotes: 0
Views: 684
Reputation: 707
You can still pass the options
prop to the Resource
component.
And you can get it like this:
const PostList = () => {
const { options } = useResourceDefinitions();
// ...
}
This is somewhat explained in the Upgrade Guide from v3 to v4:
Upvotes: 1