title: forceUpdate with React hooks
body: <p>Is there a replacement for forceUpdate that one can use with React hooks? </p>
  
  <p>My use case is a shared state between component instances. Essentially each instance is just an view into single global state. With ES6 class the code register/unregister the component with the state in componentDidMount, the state calls forceUpdate on its changes and then the render method query the global state directly.   </p>
  
  <p>I consider to switch this to hooks. Initially useEffect seemed like a perfect match for the problem. But then I realized that I did not have access to forceUpdate.</p>
  
  <p>I considered a workaround that called the useState hook to add a dummy counter and then updated the counter from the effect hook, but it felt like a hack. I can also copy all relevant shared state parameters into the component state in the effect hook and then refer to those from the state. But it essentially duplicates the state for no good bloating the code with lines that copy the state when currently I can just use those lines directly in the render method.</p>
  
  <p>Update: Here is <a href="https://codesandbox.io/s/gifted-archimedes-noqtn?fontsize=14" rel="noreferrer">codesandbox.io</a> link with shared state example that uses class components that I would like to convert to hooks without duplicating the state or using fake state updates.</p>