Categories
Mastering Development

Its correct to not include a dependency on purpose on useEffect to avoid re-renderes when using react-route?

In my case here, I want to avoid the component <Checkout/> from re-rendering once I replace the url props.history.replace(props.match.path + ‘/contact-data’ to load the component <ContactData/>. As it can be seen on useEffect when <Checkout/> loads it gets a query tail on the url, something like this: http://localhost:3000/checkout?cheese=0&salad=0&special=0&veggie=1. Then I redirect to the url, having […]