I am getting below warning on button click
findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of Transition which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more ab
here is my code https://codesandbox.io/s/zen-cartwright-v5zqy
<button
onClick={() => {
messageRef.current && messageRef.current.handleClick();
}}
>
HTML
const messageRef = useRef();
<MessageModal
ref={messageRef}
message={message.message}
severity={message.severity}
/>