问题描述
反应热加载非常好.
在一些用户交互之后,会安装一些React组件.我想实现与应用程序分离的这些组件.
There are some React components that are mounted after some user interaction. I want to implement these components separated from the application.
我不想将它们分离为不同的npm模块.我只想将它们安装到登录页面并实施.
I don't want to separate them as different npm modules though. I just want to mount them to the landing page and implement.
这就像有一个测试运行器,它分别运行每个组件不是为了测试,而是为了实时实施(更改CSS等).
This is like having a test runner that runs each component separately not for testing, but for implementing it live (changing css etc.).
这有可能吗?
推荐答案
我认为您正在描述的是分解后的样式指南"页面.看看这个gulp任务: https://github.com/pocotan001/react-styleguide-generator听起来很近.
You're describing something like a decomposed "style guide" page I think. Check out this gulp task: https://github.com/pocotan001/react-styleguide-generator it sounds close.
这篇关于如何在React应用程序中隔离和迭代单个React组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!