#use a State value on loader.

1 messages · Page 1 of 1 (latest)

ruby mortar
#

Hello, Im trying to filter the categories name and the dishes each category has on the db. It would be great if I can access instead of "frutas" a State.

steady matrix
#

because the loader runs outside React there's no way to access a state value directly, for a loader, the way to pass data is using the URL, you can use either route params (the $something) or search params (those after ?)

#

so what you should do is when you fetch that loader on a URL let's say /dishes you can do /dishes?categories=frutas