Archives : June-2018

I have 3 routes that use the same component and based on the route display slightly different content. The problem is that on every route change the whole components mounts/unmounts from scratch leading to performance issues. What is the best way to avoid the unmounting but still use the same component and have these 3 ..

Read more

In my main component, I have created a ref : this.transfernewRef = React.createRef(); And assigned it to my component, which is embedded in a Route : <Route path=”/new” render={(props) => <TransferNew {…props} origin={this.state.origin} token={this.state.token} ref={this.transfernewRef} />}/> My component, TransferNew, is also dynamically loaded using react-loadable and its Loadable component. If I print this.transfernewRef.current, I get ..

Read more

I have a React application that uses URL search params. Depending on the value of the search parameter v, the component is supposed to show different content. A possible URL might look like this: http://localhost:3000/hello?v=12345 Once the v query parameter changes in the URL, I would like my component to update. http://localhost:3000/hello?v=6789 I’m using using ..

Read more