如何在React应用程序中隔离和迭代单个React组件 [英] How to isolate and iterate over individual React components in a React application

查看:108
本文介绍了如何在React应用程序中隔离和迭代单个React组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

反应热加载非常好.

在一些用户交互之后,会安装一些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组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆