[英]Can ReactJS be used for plugins?
I need to write a plugin component that other developers can use on their websites. 我需要编写一个其他开发人员可以在其网站上使用的插件组件。
Normally I would create a jQuery plugin. 通常我会创建一个jQuery插件。
I have recently been enjoying using ReactJS for web applications, based on https://github.com/andreypopp/react-quickstart . 我最近一直在享受基于https://github.com/andreypopp/react-quickstart的用于Web应用程序的ReactJS。
Are there issues around: 周围是否有问题:
if I use ReactJS to create a plugin for (non-ReactJS) web pages? 如果我使用ReactJS为(非ReactJS)网页创建插件?
I don't why it could make an issue, but pay attention other developers would have to use React in their site just for this plugin. 我不为什么会出现问题,但要注意其他开发人员仅在该插件上必须在他们的站点中使用React。
I like React too, but jQuery is mainstream, and most websites have jQuery in them, so if I were you, I'd go jQuery for the plugin, and make a React wrapper around it. 我也喜欢React,但是jQuery是主流,并且大多数网站中都包含jQuery,因此,如果我是您,我会选择jQuery作为插件,并对其进行包装。
good luck dude! 祝你好运伙计!
一些人已经在开发可重复使用的基于反应的组件: http : //react-components.com
It's 2014 and JQuery is slowly on its way out, even if many devs are still too used to it to give it up. 现在是2014年,即使许多开发人员仍然非常习惯于放弃它,JQuery仍在缓慢发展。 If you are working on a very reusable component, I would write it in vanilla js;
如果您正在开发一个非常可重用的组件,那么我将使用vanilla js编写它; else you can write it in react yes, if it helps you to keep the bug count lower, but some people won't use it because of the dependency on react.js, probably.
否则,您可以在react yes中编写它,如果它可以帮助您减少错误计数,但是某些人可能由于对react.js的依赖而不会使用它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.