You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you have a prop that influences a second prop, resolveData is the way to handle this. Unfortunately, since resolveData is a function and not a component, you cannot use a useHook inside of it. If the data you're using originates from a useHook there isn't a great way to handle prop2 changing based on prop1.
As an example, I have an object coming from a Provider/hook where I want to do something like:
prop1 is set to x
prop2 should be updated to the value of myObjectFromContext[x]
I'm not sure if there's an alternative way to do this or even if being able to pass additional data to resolveData would help.
The text was updated successfully, but these errors were encountered:
When you have a prop that influences a second prop,
resolveData
is the way to handle this. Unfortunately, since resolveData is a function and not a component, you cannot use a useHook inside of it. If the data you're using originates from a useHook there isn't a great way to handle prop2 changing based on prop1.As an example, I have an object coming from a Provider/hook where I want to do something like:
prop1 is set to x
prop2 should be updated to the value of myObjectFromContext[x]
I'm not sure if there's an alternative way to do this or even if being able to pass additional data to resolveData would help.
The text was updated successfully, but these errors were encountered: