I don't create components in the React sense. I create a set of functions which manipulate the global state and a SPA Pug template (with mixins for modularity - but any HTML and CSS template approach would do). The functions can be grouped according to broad type (e.g. immediate actions, async effects, subscriptions to events...).
For me separation of concern is between business logic and appearance. Anything which is 'state' is controlled by functions, separately from HTML or CSS which are just expressions of state.
So I suppose at the end of the day I don't really agree with the implementation of React components. I try to re-use function and logic specifically rather than contained pieces of a website.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
With your approach, don't you feel that your code ends up being unnecessarily scattered, and therefore, a bit difficult to maintain?
I don't create components in the React sense. I create a set of functions which manipulate the global state and a SPA Pug template (with mixins for modularity - but any HTML and CSS template approach would do). The functions can be grouped according to broad type (e.g. immediate actions, async effects, subscriptions to events...).
For me separation of concern is between business logic and appearance. Anything which is 'state' is controlled by functions, separately from HTML or CSS which are just expressions of state.
So I suppose at the end of the day I don't really agree with the implementation of React components. I try to re-use function and logic specifically rather than contained pieces of a website.