I was going through Remix for quite a sometime but still not able to figure out state management. How to share the data between the components/routes? How to store the data which can be accessible by any component? And should be able to update the data from any child component. Answer First of all, remember that Remix is still React,
Tag: remix.run
Persisting select option on page refresh React Remix
I have a select with 2 options (en, no), which switches the language onChange. I store selected language to localStorage. Because I’m using Remix I cannot simply access localStorage, because of the server-side rendering, so I’m using: Select component: Translation function: My goal is to have selected option saved and persistent on page refresh, now when I refresh the page,
Why is useFetcher causing an re-render infinite loop?
I have an input. On every change to the input, I want to call an API. Here’s a simplified version of the code: The issue is, when I put urlText inside of the dependencies array, there is an infinite rendering loop, and React claims the issue is I might be updating state inside of the useEffect. However, as far as
Remix useSubmit arbitrary data
I am trying to submit a form using Remix’s useSubmit hook. But I want to be able to pass arbitrary data along with my form submit data. I have form elements with some static values that have disabled/readonly attributes, which means their value will be null on form submission. However I have access to their actual values in my post