https://github.com/michal-wrzosek/xfor-typehead
React typehead input component with autocomplete
https://github.com/michal-wrzosek/xfor-typehead
Last synced: 3 months ago
JSON representation
React typehead input component with autocomplete
- Host: GitHub
- URL: https://github.com/michal-wrzosek/xfor-typehead
- Owner: michal-wrzosek
- License: mit
- Created: 2019-06-25T18:05:30.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T01:05:49.000Z (over 2 years ago)
- Last Synced: 2025-01-21T20:48:42.150Z (5 months ago)
- Language: JavaScript
- Homepage:
- Size: 6.9 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 29
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-component-lib
This is a boilerplate repository for creating npm packages with React components written in TypeScript and using styled-components.
Medium article explaining step by step how to use this repo to publish your own library to NPM:
https://medium.com/@xfor/developing-publishing-react-component-library-to-npm-styled-components-typescript-cc8274305f5a## Installation:
To install all dependencies run `npm run install-all`.
## Developing your library:
To start developing your library, run `npm run dev`. It will build your library and run example create-react-app where you can test your components. Each time you make changes to your library or example app, app will be reloaded to reflect your changes.
## Styled-components:
Developing library with components built with styled-components is challenging because you have to keep only one instance of styled-components. If you would just symlink your library (`file:../` or `npm link`) to example app that is also using styled-components you'll get a console warning about multiple instances of styled-components (even though styled-components are peer dependency) and your styles will be possibly broken. To be able to conveniently develop styled components I am injecting bundled files directly into example app's /src folder and importing it in App.tsx along with type declaration.
## Typescript
This boilerplate lets you develop your libraries in Typescript and you can simultaneously test it in Typescript example create-react-app.