How to keep React js out of the global scope

Viewed 73

I am new to React js and I am a little bit confused.

I thought that modules would keep Web app variables in a local scope, but apparently not. React still creates globals such as window.React.

Am I missing something? Is it possible to keep React in a local scope?

My use case: I am creating a Web portal that will aggregate React-based third party widgets from multiple sources. Each widget has its own version of React and I want to make sure there is no interference.

[Edit] Some of the widgets load React from a CDN, could this make a difference? Apart from looking for window.React, are there other tests I could/should run in the global scope?

1 Answers
Related