The library that enables react to implement global components.
npm i react-global-components
yarn add react-global-components
- esNext
- React
// src/index.js or src/app.js
import ReactGlobalComponents from 'react-global-components';
ReactGlobalComponents();
// OR
import ReactGlobalComponents from 'react-global-components';
ReactGlobalComponents('../../../plugins');
// plugins/Card.js
import { Card } from 'card-components';
export default Card;
Important!!
You can call it by file name. Reserved words must not be used.
// Every Where Can Call Tt without import
export default Index() {
const func = Card();
console.log(func);
return (<Card />);
}
// .eslintrc
{
"parser": "babel-eslint"
}
This library support component, function, variable.
Now enjoy coding.
- Can make Global Components.
- Focus on bundle size and stability.
- MAJOR version when you make incompatible API changes,
- MINOR version when you add functionality in a backwards-compatible manner, and
- PATCH version when you make backwards-compatible bug fixes.
example:) v0.0.18 is
18th patched.
- Support edit basic root of the plugins folder. (MINOR)
- fix: pollyfill and find file name. (PATCH)
- Jest tests case more improve (PATCH)
- Typescript's type check more improve (PATCH)
- Compress global import size (PATCH)
This is Example boilerplate code.
You can get better way.