How can I make use of Error boundaries in functional React components? : <p>I can <a href="https://reactjs.org/blog/2017/07/26/error-handling-in-react-16.html" rel="noreferrer">make a class an error boundary</a> in React by implementing <code>componentDidCatch</code>.</p>

<p>Is there a clean approach to making a functional component into an error boundary without converting it into a class?</p>

<p>Or is this a code smell?</p>
