-
-
Notifications
You must be signed in to change notification settings - Fork 743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve performances when rendering days #181
Comments
A solution could be @lo1tuma's proposal to let the developer adopt a custom class for rendering days instead of the default one. The default I'm thinking another approach, something like: import DayPicker, { Day } from 'react-day-picker'; <DayPicker>
<Day modifier="selected" from={aDate} to={anotherDate} />
<Day modifier="disabled" day={disabledDate} />
<Day modifier="disabled" days={[fooDate, barDate]} />
<Day modifier="veryCustomClass" days={ day=> aVeryCustomLogic(day) } />
</DayPicker> The At this point i wonder if <Day disabled day={disabledDate} />
<Day selected from={aDate} to={anotherDate} /> |
Another thing I've found to significantly impact performance are the moment constructors used to format dates. In my experience formatting the |
@edorivai those seem indeed easy tweaks to improve rendering. Would you mind to send a PR? |
The issue with creating new functions at each render is solved with #254 – I think this is a better solution than multiple child |
Published as |
Thank you @gpbl 🍻. |
@lo1tuma wrote a great comment about rendering performances:
This issue is to discuss API changes required to improve the DayPicker rendering performance. All suggestions are welcome :)
The text was updated successfully, but these errors were encountered: