News for hackers. Stuff that matters.
Re:What React Gets Wrong by alfonsodev on Thursday January 07, 2021 @05:20PM (#25678439)
> React is not just a view rendering library anymore

I was felling like this too, but I found my balance using the Controller pattern, I only use hooks in controllers, and dispatch from controllers only, then I do not have logic in controllers, but I added some concepts of DDD having all the business logic separated, to the point I could change the whole ui framework (let's say material-ui by fluent-ui) and it wouldn't affect any controller, business logic or application types.

So with Typescript + Controller pattern + DDD concepts I'm quite happy with the separation of concerns.

This is how a route looks with Controller pattern.

        <Route exact path="/:username">
            <SignedInLayout backgroundType="paper">
                <ProfilePageController>
                {(props: ProfilePageProps) => (
                    <ProfilePage {...props} />
                )}
                </ProfilePageController>
            </SignedInLayout>
        </Route>
Re:What React Gets Wrong by renke1 on Thursday January 07, 2021 @05:26PM (#25678524)
Any example repo or more detailed description of your approach (directory structure, building blocks, rules between these etc.) that you are willing to share? – We are discussing (and using) a very similar approach to yours so we are always looking for more input (especially on the DDD part).

In our case we have two widely different applications (the one being a "true" SPA with a single page and the other being a more route heavy application) and we try to converge on an approach that works for both (might not be reasonable, though).

Re:What React Gets Wrong by rhacker on Thursday January 07, 2021 @08:47PM (#25680380)
This is what I love about react. There's so many ways to do things and I feel like every now and then someone finds a new way to optimize and reduce boilerplate even more. Nice job.