I am using the library "react-modal" for Modal components. How do I render these modal components using ReactDOM in a function? I have seen some examples that work for "react-bootstrap" but not for "react-modal". I tried the following approach but it does not work. Any help would be really appreciated.
//Pseudo code.
import Modal from "react-modal";
Modal.setAppElement('#root')
<button onclick={() => {
const response = //async call...
ReactDOM.render(<Modal props={response}/>)
}}/>