-
Notifications
You must be signed in to change notification settings - Fork 17
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
Creating RRS Reusable Formik Field or Component #147
Comments
On further Checking, I realized that the caretIcon property is the cause, If I remove the property, the component works very well but immediately I add it back, it becomes very slow even with using RRS directly on my form |
Which version are you on @carlospence ? Also could you try Also please try the next version of I will have a look and see if there is something unusual going on in the |
Thanks for all the details @carlospence 👍 This is interesting. I have not noticed any speed problems before with the caretIcon. I am rendering whatever is in caretIcon like this https://github.com/benbowes/react-responsive-select/blob/master/src/components/SingleSelect.tsx#L82 e.g.
The same way I would render Is it possible that If it is not set or is changing, it might be causing the component to re-render multiple times. |
Please also try spreading the props on the
Which should enable you to remove the |
This CaretIcon ☝️ is exactly the same as the existing CaretIcon in RRS, except for the spread props. |
Thanks, I just added the spread props and there was a very good improvement on the single select. But on the multiple select with markup component. If I include the , there is still some form of sluggishness. I added the spread props on the MultiSelectOptionMarkup components. It didn't lead to any improvement. Can you check out my Formik Component to see if anything could trigger re-rendering #148 And I called the component this way:
I toggled between options with MultiSelectOptionMarkup and without |
I am not sure if you have tried using these versions of components for the MultiSelectOptionsMarkup? But based on what you have discovered above, I think the spread props I have here, should be spread over the CheckboxIcon
like this:
|
Really appreciate your help with this |
@benbowes Not a problem @ALL. I really appreciate your prompt responses also and help so far. There have been an appreciable improvement but not up to the speed of no caretIcon or no MultiSelectOptionMarkup. I even think the major snag is still with the MultiSelectOptionMarkup. Though there was slight improvement but the improvement is more obvious with single select than with multiselect. However, using noSelectionLabel with multiselect cause the component to freeze when making selections. It works well with single select and the major reason I want to use this component is for its multiselect on mobile. I like the way it pops up like native select on mobile. |
@carlospence I haven't tried using Formik Field, but I can see that I need to put a multiselect example in the docs Some thing like this in react-responsive select-next (soon to be react-responsive-select) would give some insight in to how to go:
|
see #150 |
I Created a Formik Component for RRS, so as to reuse it instead of repeating so many codes while creating form but whenever I use the component, it slows down every other components on the form. If I use the RRS component directly on the form, it is fast. When I now used Formik Component, it was slightly faster but still slow.
This is the reuseable formik component code
Used it in my form like this. If I should change the to , it is a little bit faster.
Note: I made use of reactstrap.
The text was updated successfully, but these errors were encountered: