简体   繁体   English

如何在React应用程序中隔离和迭代单个React组件

[英]How to isolate and iterate over individual React components in a React application

React hot loading is very nice. 反应热加载非常好。

There are some React components that are mounted after some user interaction. 在一些用户交互之后,会安装一些React组件。 I want to implement these components separated from the application. 我想实现与应用程序分离的这些组件。

I don't want to separate them as different npm modules though. 我不想将它们分离为不同的npm模块。 I just want to mount them to the landing page and implement. 我只想将它们安装到登录页面并实施。

This is like having a test runner that runs each component separately not for testing, but for implementing it live (changing css etc.). 这就像有一个测试运行器,它分别运行每个组件不是为了测试而是为了实时实施(更改CSS等)。

Is this possible somehow? 这有可能吗?

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. 看看这个gulp任务: https : //github.com/pocotan001/react-styleguide-generator听起来很关闭。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM