You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| onSelect | (address) => void | yes | address => console.log(address) | Callback with for Loqate response |
39
40
| countries | string[]| no |["GB", "NL"]| Countries to search in |
40
41
| limit | number | no | 10 | Number of options to show |
41
-
| className | string | no | "address-search-box" | Classname for the component wrapper |
42
42
| classes |`{ input?: string, list?: string, listItem?: string}`| no | { list: 'list' } | Classnames for the components |
43
43
| components | see [Customization](#Customization)| no | { Input: CustomInput, List: CustomList, ListItem: CustomListItem, } | Components to overwrite the default ones |
44
44
| inline | boolean | no | true | Render results inline with the input |
45
45
| debounce | number | no | 100 | Debounce the calls to the Loqate API |
46
46
47
47
### Customization
48
48
49
-
You can either style the default input, list and listItem with their respective classes or replace them completely by passing in your own components in the components prop.
49
+
You can either style the default input, list and listitem with their respective classes or replace them completely by passing in your own components in the components prop.
50
50
51
-
**List component must be able to accept a ref!**
51
+
**Input and List components must be able to accept a ref, either through using forwardRef or being a base html element**
52
52
53
53
**All custom components must pass down their props!**
54
54
55
55
```javascript
56
56
importReactfrom'react';
57
57
importAddressSearchfrom'react-loqate';
58
58
59
-
constCustomInput= (props):JSX.Element=> {
60
-
return (
61
-
<input
62
-
placeholder={'start typing your address or postcode'}
0 commit comments