- cd /storybook/
- npm i
- npm run storybook
- open http://localhost:6006/
- work inside storybook/stories/LightAutocomplete
Publish a new version
- npm i
- edit package.json and bump a version
- npm run build (this command execute production build with webpack and puts the files at dist folder)
- npm publish
- cd /json-mock-api
- npm i
- npm start
- curl http://localhost:3004/names
- change /src/app lines with axios to fetch data from json server
- npm install light-react-autocomplete
- write use this example:
let mock = ['user1' , 'user 2'];
let asyncMock = () => Promise.resolve({data: mock});
let autocompleteStyle = {
width: 300
}
let listStyle = {
width: 330
}
const myComp = () => {
return <LightAutocomplete
asyncCall={asyncMock}
onSubmit={(e,selectedItem) => console.log('submit form!', e,selectedItem)}
autocompleteStyle={autocompleteStyle}
listStyle={listStyle}
inputToRender={(params) => <input type="text"
{...params}
/>
}
/>
}