JS: React and global namespace pollution
This is not exactly a React JS question since any large JavaScript codebase has to deal with module loading. I suggest forgoing namespacing in JavaScript the way you started to approach it and instead use a module loader.
You will get many opinions on this, but look at some of the widely-used module loaders:
- Browserify
- rollup.js
- Webpack
this code is work.
React.renderComponent(
Namespace.MySlider(),
document.getElementById('content')
);
See the documentation for more information.