2.0.0 • Published 6 years ago
react-postcode v2.0.0
Postcode Search: React Component

Docs
Installing
yarn add postcode-search
Make sure you have the peer dependencies installed too:
yarn add react prop-types
Importing Component
import PostcodeSearch from 'react-postcode'Importing Styles
import 'react-postcode/dist/index.css'Props
apiKey: stringapiUrl: stringclassName: stringlabel: stringmapItem: funcmenuClassName: stringonBlur: funconFetch: funconFocus: funconSelect: funcoutlined: boolstyle: objecttextFieldClassName: string
Example
import React from 'react'
import PostcodeSearch from 'react-postcode'
import 'react-postcode/dist/index.css'
const App = () => (
<div style={{ maxWidth: '200px', margin: '100px auto', }}>
<PostcodeSearch
onFetch={postcode => {
console.log(postcode)
}}
/>
</div>
)Developing
yarnyarn start
The component is rendered at http://localhost:3001 and updates automatically when editing the source code in ./src/index.js.
Publishing
yarn publish