1.2.0 • Published 2 years ago
yudi-components v1.2.0
This is example how to publish components into NPM package
Getting Started
Signup on npm website
How to create new components (camel case naming)
- Create new directory "ComponentName" inside directory "components"
- Create new file "index.js" inside your created component directory "ComponentName"
- Create file style "component-name.css" inside your created component directory "ComponentName"
- Add your created components to "components/index.js"
import Button from './ComponentName1';
import Button from './ComponentName2';
export{
ComponentName1,
ComponentName2
}
Publish into NPM
npm login
npm version (ex. 1.0.0)
npm run build:npm
npm publish
How to use
- Create your new react project
npm install yudi-components
- Then
import {Button} from 'yudi-components/dist'
function App() {
return (
<div>
<Button action={() => alert('lala')} text={"Click Me"} />
</div>
);
}