react-aria-modal | fully accessible React modal | Frontend Framework library
kandi X-RAY | react-aria-modal Summary
kandi X-RAY | react-aria-modal Summary
A fully accessible React modal built according WAI-ARIA Authoring Practices
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of react-aria-modal
react-aria-modal Key Features
react-aria-modal Examples and Code Snippets
Community Discussions
Trending Discussions on react-aria-modal
QUESTION
I am failing to understand why I can't use react-table with react-modal or react-aria-modal. When I try to display the modal, the component that displays react-table is constantly re-renders, and eventually crashes because of a Maximum update depth
error.
I've created a CodeSandbox to illustrate the issue. Is there a way to use both components in the same tree?
The CodeSandbox doesn't show this error for some reason, but in development I also get this error (these stack traces appear to be coming from react-table):
...ANSWER
Answered 2020-Jun-30 at 22:45You need to memoize the options, which react-table mentions in some of its documentation. The options includes the columns, which you are currently not memoizing, so it gets new columns on each render (because columns is defined in the same scope as an array and [] !== []
), and then re-renders.
The quickest way to fix it is to wrap your columns
data in a React.useMemo
;
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install react-aria-modal
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page