react-ecs | An entity-component-system for React | Frontend Framework library
kandi X-RAY | react-ecs Summary
kandi X-RAY | react-ecs Summary
An entity-component-system for React
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-ecs
react-ecs Key Features
react-ecs Examples and Code Snippets
Community Discussions
Trending Discussions on react-ecs
QUESTION
I'm trying to get a functional component to force a rerender whenever the testFn
executes. I thought to use state to do this (if there's a better way then please speak up), which appears to successfully force a rerender but only twice, then nothing.
I built a simple demo to emulate the issue as using my real app is too difficult to demonstrate but the same principles should presumably apply (my real demo fetches data when the function executes and displays it on the page, but it's not rerendering and I have to refresh the page to see the new data, hence why I want to trigger a rerender).
...ANSWER
Answered 2021-Feb-02 at 17:16State is the right way, since state changes are the primary way to cause re-renders. I'd increment a counter:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install react-ecs
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