简体   繁体   中英

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.

I have recently been enjoying using ReactJS for web applications, based on https://github.com/andreypopp/react-quickstart .

Are there issues around:

  • filesizes
  • namespaces
  • multiple versions of the plugin in one page
  • multiple instances of the plugin in one page

if I use ReactJS to create a plugin for (non-ReactJS) web pages?

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.

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.

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. If you are working on a very reusable component, I would write it in 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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