reactjs - Lifting React state up & storybook - Stack Overflow

I just joined a new team that has a pattern of "lifting state up" in their React components.

I just joined a new team that has a pattern of "lifting state up" in their React components. So for example - a colour picker component, relies on a parent component to handle onColourChange events and set the colour prop.

This makes sense since it makes those components more flexible, however it also moves complexity to parent components.

What's more, is that looking at tools like Storybook, which the team is pretty keen to use, this pattern would mean more complex stories, which is a downside.

Summary: Is this a common pattern that's widely used?

I'm somewhat experienced in React, but I don't have the depth and breadth of React knowledge at this stage to fully evaluate this. All I know is that I haven't come across this pattern in the past being used as the default - it's more of a case by case basis, whereas here it seems to be the default.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744816958a4595383.html

相关推荐

  • reactjs - Lifting React state up & storybook - Stack Overflow

    I just joined a new team that has a pattern of "lifting state up" in their React components.

    2天前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信