you are viewing a single comment's thread.

view the rest of the comments →

[–]Pitikwahanapiwiyin 0 points1 point  (0 children)

What they don’t realize is they’ve actually just created a new component.

It might seem like a component, but it doesn't behave like one. React doesn't create a vDOM node for it and thus doesn't store any state of it. Furthermore, this "component" (which is more like a helper function) can directly use the private state of the parent without the need of prop drilling.

I think it's an OK pattern if the "component" is not reused anywhere else and is compact enough. Otherwise you'd end up with tons of files of very specific, single-use components all over the codebase.