简体   繁体   English

在浏览器中渲染单个 React 组件以进行本地开发

[英]Render Individual React Components in browser for local development

I am creating a JS Library which acts as a React Widget for a main application.我正在创建一个 JS 库,它充当主应用程序的 React 小部件。 I integration process with the main library is a little complex which makes local development difficult as I have to setup a servers at all times.我与主库的集成过程有点复杂,这使得本地开发变得困难,因为我必须始终设置服务器。 So what I am seeking is a way to 1st setup a mock server and then somehow render my widget on local host while it feeds of Mock server so I can make my development process seamless.所以我正在寻找一种方法来首先设置一个模拟服务器,然后以某种方式在本地主机上渲染我的小部件,同时它提供模拟服务器,这样我就可以使我的开发过程无缝。 I am rather new to this style of development and would love some guidance on what js technologies/libraries I can look into for achieving above stated goal.我对这种开发风格相当陌生,并且希望获得一些关于我可以研究哪些 js 技术/库以实现上述目标的指导。

any recommendation on setup for local development of React Libraries is much appreciated.非常感谢任何有关设置本地开发 React 库的建议。 thanks!谢谢!

To serve static files locally, you can use serve package https://www.npmjs.com/package/serve要在本地提供 static 文件,您可以使用 serve package https://www.npmjs.com/package/serve

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

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