hs-component-lib v1.0.0
hs-component-lib
Showcase is a meticulously designed and lightweight collection of customizable react components that streamline development, enhance visual appeal, and ensure seamless performance
Getting Started
Follow these steps to set up and use the library in your project.
1. Install Dependencies
npm install hs-component-lib
sudo npm run storybook
2. Usage
Import and use components from the library in your React project:
import React from 'react';
import ReactDOM from 'react-dom';
import { Button } from 'my-react-library';
const App = () => (
<div>
<Button label="Click me" />
</div>
);
ReactDOM.render(<App />, document.getElementById('root'));`
3. Development
If you want to make changes to the library and test them in your project, follow these steps:
a. Clone the Repository
git clone https://github.com/your-username/hs-component-lib
.git
cd hs-component-lib
b. Install Dependencies
npm install
c. Build the Library
npm run build
4. NPM Link
To test changes locally without publishing the library to NPM, you can use npm link
.
a. Link the Library
In the library directory:
npm link
b. Link in Your Project
In your project directory:
npm link hs-showcase
Now, any changes you make in the library will be reflected in your project without the need for a manual update or publishing to NPM.
5. Additional Information
Babel Configuration: Babel is configured using
.babelrc
in the root of the project.Rollup Configuration: Rollup is configured using
rollup.config.js
in the root of the project.
Assuming myapp and mylib are sibling folders, one possible fix is to run npm link ../myapp/node_modules/react from mylib. This should make the library use the application’s React copy.
2 months ago