Send Select without a form with GET method not working... React #1774
-
Hi guys, basically I need a order-by select filter for my data, problem is that state form changes correctly but is sends JS:
CONTROLLER:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think it's just an issue with how you're using the React state. When you call handleSubmit within the handle change function, it's still using the previous value of data, because React hasn't re-rendered the component. To resolve, you'd either need to use a useEffect watching the value of data, or use router.get within the handleChange function. |
Beta Was this translation helpful? Give feedback.
I think it's just an issue with how you're using the React state. When you call handleSubmit within the handle change function, it's still using the previous value of data, because React hasn't re-rendered the component.
To resolve, you'd either need to use a useEffect watching the value of data, or use router.get within the handleChange function.