Skip to content
Advertisement

Tag: reactjs

How to detect a query param appended to URL using pure React

I have an injected external widget in my React application that have some links and when clicking in these links a query param is appended to the URL. Imagine something like this: base url: http://localhost:8080/ url after adding the query param: http://localhost:8080/?shouldOpenModal Is there any way to detect this appended query param to the URL using React? It’s important in

GET request with axios (using await) returning undefined

I’m using axios to get data and then handle 401 error and so far it works, but there is a problem when I try to import my axios function and use it I got undefiend but not the actual response. Btw I have seen simillar questions and didn’t find answear. axios function code the fetching part what I get on

Fields in Formik (validated on Yup) are constantly displaying an error as if they are empty or invalid. find codesandbox-link attached below

//The onChange variable in the fields is updated on the above code. I am unable to find the solution towards making the below fields function properly. I tried using formik’s setFieldValue however It didn’t work The below code is the return function: Sandbox Answer Simply use Formik’s handleChange event and values. You don’t need to create custom functions or states

How can I setState of specific Switch created dynamically by a map?

I have Switches created dynamically by a map like this: https://i.imgur.com/KuwY5Bb.png By this code: And it’s works but when I click one Switcher all switchers change together. This is happening because all Switches are created with the same “reference” enabled. How I set an individual var to each Switcher without Hardcoding individuals [enabled, setEnabled] to each one (I have more

Advertisement