Socket
Socket
Sign inDemoInstall

global-react

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

global-react

Let multiple browserified React components co-exists


Version published
Maintainers
1
Created
Source

global-react

When you want something like

<script src="path/to/react-component-1.js"></script>
<script src="path/to/react-component-2.js"></script>
<script src="path/to/react-app.js"></script>

that you can use component-1 and component-2 in app, but react-component-1.js and react-component-2.js are browserified along with React already, you will run into errors.

How to solve it

npm install --save-dev global-react
browserify entry1.js -g global-react -o react-component-1.js
browserify entry2.js -g global-react -o react-component-2.js
browserify app.js    -g global-react -o react-app.js

Change the HTML page to

<script src="path/to/global.react.js"></script>
<script src="path/to/react-component-1.js"></script>
<script src="path/to/react-component-2.js"></script>
<script src="path/to/react-app.js"></script>

Keywords

FAQs

Package last updated on 20 Oct 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc