score:3
Accepted answer
i found an answer from yachaka who posted in this github issue for react-modal.
the script is loaded before the dom, resulting in react-modal setting the parent element of the modal to document.body
before it exists.
this can be fixed by adding the lifecycle method componentwillmount
as follows:
componentwillmount: function() {
reactmodal.setappelement('body');
}
Source: stackoverflow.com
Related Query
- Bootstrap Modal causes 'Uncaught TypeError: Cannot convert undefined or null to object' error in Heroku with Rails 6 app
- Error on calling react-modal in rails 4 app
- 401 Unauthorized error in rails api-only app when using React
- Modal react component in material-ui app throwing error
- Error with calling graphQl mutation from react app
- Error Running React Native App From Terminal (iOS)
- Error while creating new React app ("You are running `create-react-app` 4.0.3, which is behind the latest release (5.0.0)")
- Error when deploying react app and it keeps sayings << Plugin "react" was conflicted between "package.json » eslint-config-react-app » >>
- I'm getting error like this while creating react app
- Create React App not showing error message with ErrorBoundary
- Getting an "Access Denied" error when I reload my React app on AWS Amplify
- React app runs locally, crashes when on Heroku error code=H10
- CORS error while consuming calling REST API with React
- Trying to deploy my React app with gh-pages but got this error message : The "file" argument must be of type string. Received type undefined
- Azure App Service Getting error while deploying REACT JS application
- Create React App not installing, showing an error and aborting installation
- Getting 403 ACCESS DENIED error when deploying React Web app on AWS Amplify
- eslint error on deployment on local server of react web app
- eslint error on deployment on local server of react web app
- Error on archiving react native app in Xcode - Multiple commands produce 'libyoga.a'
- How to Fix Heroku Application Error For a Successfully Deployed React App
- React Native App crashes on android 11 on launch without giving error
- Keep getting error while creating react app
- How to solve TypeScript error with axios response in React app
- How to make React Create App Production Error Boundary map to source code
- 404 Error on refresh with SPA React Router app in GitHub Pages
- react with Rails 5, getting CSRF error for post with axios
- React - Material-UI Modal causing an error with the tabindex
- React App returns error after refresh
- React app returning 500 Internal Server Error
More Query from same tag
- react-query: why is this one query always stale?
- How to simulate changing the value of a child with React-Enzyme
- How do I generate more than one dom element from a react.rb component
- Form in React w/ different input types
- UnhandledPromiseRejectionWarning: Error: Cannot find module '/MyProject/node_modules/react-native-scripts/build/scripts/init.js'
- react-signature-canvas clears initial user input
- How to send pass function as props to child component
- React with D3 - Only rendering new items without updating or removing old ones
- setState function in reactjs is not setting state. How to overcome this problem?
- React and NextJS: Module parse failed: Unexpected token
- How do I use Config Vars in Heroku to get my API key to work?
- Array or iterator should have a unique "key" prop
- How to refactor this component to avoid repetition?
- Can't call object method on previous state in setState hook inside subscribe body
- How I can add multiple same fields form in reactJS?
- React i18next - Don't show translations until request finished
- React js paste a previously copied text by clicking on a button
- How to search again in data state after set state function
- Using Grid with SortableJS
- React bootstrap hook onClick event function being struck-called by other event function
- Search in Redux store if specific string exists in messages array
- React: accessible unordered list of buttons
- JavaScript Array Map returns empty array
- Attempting to render Firebase Auth details returning 'undefined' in React web app
- Error in React-Router: 'Type expected. TS1110' after deleting my node_modules folder and package-lock.json
- How to render string including JSX component with PascalCase in React?
- useSelector causing rerender despite using shallowEqual?
- Express '/' GET request fails, but '/' post, put, delete succeed
- Enzyme wrapper.state returns null
- Redux how to access state