简体   繁体   English

ReactJS可以用于插件吗?

[英]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: 周围是否有问题:

  • 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? 如果我使用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.

相关问题 羊驼js可以在ReactJS中使用吗 - Can Alpaca js be used in ReactJS 有人能解释一下Twitter Bootstrap插件中使用的这个javascript模式吗? - Can someone explain this javascript pattern used in the Twitter Bootstrap plugins to me? 引导程序可以用于网站插件而不会与网站样式和js冲突吗? - Can bootstrap be used for website plugins without conflicting with site styles and js? 可以在同一.js文件中使用reactJS和Vanilla JavaScript吗? - Can both reactJS and Vanilla JavaScript be used in the same .js file? 为什么箭头函数可以在ReactJS类上使用而不能在纯ES6类上使用? - Why arrow functions can be used on ReactJS classes but not on a pure ES6 class? 如何在 ReactJS 中制作可重复使用的下拉过滤器,它是 DRY 并且可以在同一组件中使用两次 - How to make a reusable dropdown filter in ReactJS which is DRY and can be used twice in the same component WebRTC,远程stream无法使用,如何检查它是否正常工作(ReactJs)? - WebRTC, remote stream can't be used, how to check if it's working (ReactJs)? 仅在页面中包含来自使用过的插件的脚本 - Only include scripts from used plugins in page 如何使第三方Vue库可以访问正在使用的其他第三方Vue插件? - How can I make a third party Vue library have access to other third-party Vue plugins being used? vue中不能使用插件 - Can't use plugins in vue
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM