GithubHelp home page GithubHelp logo

isabella232 / react-lib-template Goto Github PK

View Code? Open in Web Editor NEW

This project forked from moxystudio/react-lib-template

0.0 0.0 0.0 2.98 MB

This template aims to make the implementation of react component packages easier and more methodic.

License: MIT License

JavaScript 91.81% CSS 8.19%

react-lib-template's Introduction


⚠️ PLEASE READ THE INSTRUCTIONS FOR GUIDELINES ON HOW TO START YOUR PACKAGE.

Don't forget to remove this warning while updating this README.


{package-name}

NPM version Downloads Build Status Coverage Status Dependency status Dev Dependency status

{package-description}

Installation

$ npm install @moxy/{package-name}

This library is written in modern JavaScript and is published in both CommonJS and ES module transpiled variants. If you target older browsers please make sure to transpile accordingly.

Motivation

{package-motivation}

Usage

{package-usage-example}

API

{package-api-description}

{package-api-prop-example}

Type: object Required: true

The {package-api-prop-example} has the following shape:

{package-api-prop-example}: PropTypes.shape({
    foo: PropTypes.string,
    bar: PropTypes.arrayOf(PropTypes.object),
}).isRequired,

Tests

$ npm test
$ npm test -- --watch # during development

Demo

A demo Next.js project is available in the /demo folder so you can try out this component.

First, build the {package-name} project with:

$ npm run build

Note: Everytime a change is made to the package a rebuild is required to reflect those changes on the demo. While developing, it may be a good idea to run the dev script, so you won't need to manually run the build after every change

$ npm run dev

To run the demo, do the following inside the demo's folder:

$ npm i
$ npm run dev

FAQ

I can't override the component's CSS, what's happening?

There is an ongoing next.js issue about the loading order of modules and global CSS in development mode. This has been fixed in v9.3.6-canary.0, so you can either update next.js to a version higher than v9.3.5, or simply increase the CSS specificity when overriding component's classes, as we did in the demo, e.g. having the page or section CSS wrap the component's one.

License

Released under the MIT License.

react-lib-template's People

Contributors

afonsovreis avatar dependabot[bot] avatar fsdiogo avatar paulobmarcos avatar ruimonteiro93 avatar ruipneves avatar satazor avatar ubmit avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.