You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm noticing as I look over the source code, that sometimes components are written as class components, other times as function components. I'm guessing there's probably been some re-writing of the code over time. Is there any other specific reason for a different approach in how certain components are written? Or perhaps we could contribute to rewriting them using just one style? I think it would make for better readability and maintainability...
Actually I'm seeing that all components are Class components except one. Only WelcomeModal.js is written as a Function component. Personally I do prefer the Function component style...
The text was updated successfully, but these errors were encountered:
I wrote most of the original source using class components. I don't have a strong opinion, I just hadn't written that much react and chose one.
Someone else contributed the WelcomeModal and happened to use a functional component.
I don't personally care too much one way or the other, but I'd be fine with rewriting things in the functional style for the sake of maintainability and consistency.
I'm converting everything to function components as part of the Astro rewrite, so that will fix this. It does seem clear that function components are preferable in modern React code. Currently in development on the astro branch. (Preview)
I'm noticing as I look over the source code, that sometimes components are written as class components, other times as function components. I'm guessing there's probably been some re-writing of the code over time. Is there any other specific reason for a different approach in how certain components are written? Or perhaps we could contribute to rewriting them using just one style? I think it would make for better readability and maintainability...
Actually I'm seeing that all components are Class components except one. Only
WelcomeModal.js
is written as a Function component. Personally I do prefer the Function component style...The text was updated successfully, but these errors were encountered: