The component does not re-render
See original GitHub issueHere’s the code base
const [startDate, setStartDate] = useState<Date>(undefined);
const [endDate, setEndDate] = useState<Date>(undefined);
const onDayPress = (day: Date) => {
setEndDate(new Date(day));
setStartDate(new Date(day));
};
<Calendar
onPress={onDayPress}
startDate={startDate}
endDate={endDate} />
on pressing on any day, the component does not re-render
when I press CMD + S, and save
the hot reload re-render the component and show the expected output
Issue Analytics
- State:
- Created a year ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
React component not re-rendering on state change
@Thamaraiselvam Most likely it is because react only sees the object as a pointer. So React can't recognize that the object has changed...
Read more >How and when to force a React component to re-render
React automatically re-renders components, but what happens when a component is not updating as expected? Find out what you can do here.
Read more >5 Ways to Avoid React Component Re-Renderings
5 Ways to Avoid React Component Re-Renderings · 1. Memoization using useMemo() and UseCallback() Hooks · 2. API Call Optimization with React Query...
Read more >When does React re-render components? - Felix Gerschau
React DevTools lets you highlight renders under Components -> View Settings -> Highlight updates when components render. This will show you the ...
Read more >4 methods to force a re-render in React
1. Re-render component when state changes ... Any time a React component state has changed, React has to run the render() method. ......
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
@maggialejandro
I caught the issue in my code
it’s related to the startingMonth attribute, I assign something wrong , format or value
Will close the ticket, looks not related to the library
@maggialejandro Sure, will debug it and get back to you