Simple way to namespace React components
import React from 'react';
export class Foo extends React.Component {
render() {
return <div>foo</div>;
}
}
export class Bar extends React.Component {
render() {
return <div>bar</div>;
}
}
import React from 'react';
import * as My from './components/my-components.js';
export default class App extends React.Component {
render() {
return (
<div>
<My.Foo />
<My.Bar />
</div>
);
}
}