HOC goes against react and is making this plugin hard to use #602
jnovak-SM2Dev
started this conversation in
General
Replies: 1 comment 3 replies
-
Can you elaborate on why you believe this "goes against React"? React is built on using re-renders for changed state. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
To bring this up again, I think the HOC fix is not a great way to go for this plugin. I'm using this for a select that shows how many of the options were found in the search, so the label of each item will change as the user selects options. This obviously causes the entire thing to re-render (even with hoc) since the data changed.
I think fighting against the natural way react works is making this component a lot harder to use than it needs to be. If this just had a "selected" or "values" field that could be updated and would find and check said values in the data, I think it would work a lot better and be easier to use. I see one of the arguments was that the plugin should maintain it's own state, but that isn't how react components normally work and is not how forms generally work in react. Especially when you are passing in the data to the component that controls what it shows and when that data updates the component loses all semblance of what was open. That to me is a huge problem and is the opposite of how any other select component out there works.
Beta Was this translation helpful? Give feedback.
All reactions