Skip to content

The library that enables react to implement global components.

License

Notifications You must be signed in to change notification settings

devxian96/react-global-components

Repository files navigation

react-global-components

npm npm GitHub stars GitHub forks GitHub issues GitHub issues

The library that enables react to implement global components.

Npm / Yarn

npm i react-global-components

yarn add react-global-components

Getting started

Requirement

  • esNext
  • React

Edit File

// 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.

Features

  • Can make Global Components.
  • Focus on bundle size and stability.

Update

  • 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.

Updated New Version

  • 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)

Update Scheduled

  • Compress global import size (PATCH)

Examples

This is Example boilerplate code.
You can get better way.

About

The library that enables react to implement global components.

Topics

Resources

License

Security policy

Stars

Watchers

Forks