Changing resources prop does not update in render
See original GitHub issueWhen the resources prop is changed, the calendar does not rerender. This is inconsistent with the way that the React flow works.
For example, if an async request is working in the background and it finishes, with a new resources array, and the render()
function of the parent component is called, the calendar is not rerendered.
While the docs mention a resources function for use with ajax, this does not work with my workflow (because the information is stored in redux and used with other components), and does not align with proper React flow.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
React props not updating - Stack Overflow
I have a parent class component that has a function in componentWillMount that loops through a list of strings and creates an element...
Read more >How to update a component's prop in ReactJS — oh yes, it's ...
Props are never to be updated. We are to use them as is. Sounds rigid right? But React has its reasons behind this...
Read more >Why React Child Components Don't Update on Prop Changes
In React, it's a common problem to have child components that don't re- render when you expect them to. In particular, a common...
Read more >Learn how to force react components to rerender without ...
React components re-render on their own whenever there are some changes in their props or state. Simply updating the state, from a random ......
Read more >React.Component
An update can be caused by changes to props or state. ... The render() function should be pure, meaning that it does not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You could fork the example react fullcalendar example here https://codesandbox.io/s/2z6wp2jozn) to reproduce the issue?
~~In my case it is actually throwing error https://github.com/fullcalendar/fullcalendar-scheduler/issues/527#issuecomment-639452902~~
When resources change from empty array to something else(useeffect fetches data and populates)UPDATE: NVM, our old code had logical bug which was passing
null
resources instead of[]
in one case, and next time resources were sent it started throwing this error. Fixed by passing[]
if no resources.