Open Sauravroy1987 opened 3 months ago
Error occurred while returning Modal tag in React.
const OptionModal = (props) => { return ( <div style={{ textAlign: "center", display: "block", padding: 30, margin: "auto", }}
{/* <h1 style={{ color: "green" }}>GeeksforGeeks Modal Component in ReactJS? */} GFG
{/* <h1 style={{ color: "green" }}>GeeksforGeeks
export default OptionModal;
Exception: react-dom.js:17859 Uncaught Invariant Violation: Modal.render(): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object. at invariant (https://unpkg.com/react-dom@15/dist/react-dom.js:17859:15) at ReactCompositeComponentWrapper._renderValidatedComponent (https://unpkg.com/react-dom@15/dist/react-dom.js:5234:136) at ReactCompositeComponentWrapper.performInitialMount (https://unpkg.com/react-dom@15/dist/react-dom.js:4765:30) at ReactCompositeComponentWrapper.mountComponent (https://unpkg.com/react-dom@15/dist/react-dom.js:4661:21) at Object.mountComponent (https://unpkg.com/react-dom@15/dist/react-dom.js:11409:35)
Could you please help here. Thanks in advance.
your code seems incomplete, can you please elaborate the issue
Summary:
Error occurred while returning Modal tag in React.
Steps to reproduce:
const OptionModal = (props) => { return ( <div style={{ textAlign: "center", display: "block", padding: 30, margin: "auto", }}
export default OptionModal;
Exception: react-dom.js:17859 Uncaught Invariant Violation: Modal.render(): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object. at invariant (https://unpkg.com/react-dom@15/dist/react-dom.js:17859:15) at ReactCompositeComponentWrapper._renderValidatedComponent (https://unpkg.com/react-dom@15/dist/react-dom.js:5234:136) at ReactCompositeComponentWrapper.performInitialMount (https://unpkg.com/react-dom@15/dist/react-dom.js:4765:30) at ReactCompositeComponentWrapper.mountComponent (https://unpkg.com/react-dom@15/dist/react-dom.js:4661:21) at Object.mountComponent (https://unpkg.com/react-dom@15/dist/react-dom.js:11409:35)
Could you please help here. Thanks in advance.
Expected behavior:
Link to example of issue:
Additional notes: