Skip to content

Commit 2ecc6c8

Browse files
committed
fix: reset readme
1 parent 89a55ae commit 2ecc6c8

File tree

1 file changed

+44
-48
lines changed

1 file changed

+44
-48
lines changed

README.md

Lines changed: 44 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@ yarn add react-native-google-places-textinput
3838
## Prerequisites
3939

4040
1. **Enable the Places API (New)** in your Google Cloud Project
41-
4241
- This component specifically requires the new `Places API (New)`, not the legacy `Places API`
43-
- In the [Google Cloud Console](https://console.cloud.google.com/), go to `APIs & Services` > `Library` and search for "_Places API (New)_"
42+
- In the [Google Cloud Console](https://console.cloud.google.com/), go to `APIs & Services` > `Library` and search for "*Places API (New)*"
4443

4544
2. **Create an API key**
4645
- Go to "APIs & Services" > "Credentials" and create a new API key
@@ -49,7 +48,6 @@ yarn add react-native-google-places-textinput
4948
## Usage
5049

5150
### Basic Example
52-
5351
```javascript
5452
import GooglePlacesTextInput from 'react-native-google-places-textinput';
5553

@@ -88,7 +86,6 @@ const ConfiguredExample = () => {
8886
);
8987
};
9088
```
91-
9289
</details>
9390

9491
<details>
@@ -125,14 +122,14 @@ const StyledExample = () => {
125122
secondary: {
126123
fontSize: 14,
127124
color: '#666',
128-
},
125+
}
129126
},
130127
loadingIndicator: {
131128
color: '#999',
132129
},
133130
placeholder: {
134131
color: '#999',
135-
},
132+
}
136133
};
137134

138135
return (
@@ -145,7 +142,6 @@ const StyledExample = () => {
145142
);
146143
};
147144
```
148-
149145
</details>
150146

151147
<details>
@@ -155,8 +151,8 @@ const StyledExample = () => {
155151
const PlaceDetailsExample = () => {
156152
const handlePlaceSelect = (place) => {
157153
console.log('Selected place:', place);
158-
159-
// Access detailed place information
154+
155+
// Access detailed place information
160156
if (place.details) {
161157
console.log(place.details);
162158
}
@@ -178,20 +174,22 @@ const PlaceDetailsExample = () => {
178174
'location',
179175
'viewport',
180176
'photos',
181-
'types',
177+
'types'
182178
]}
183179
/>
184180
);
185181
};
186182
```
187-
188183
</details>
189184

190185
<details>
191186
<summary>Example embed in vertical ScrollView</summary>
192187

193188
```javascript
194-
<ScrollView keyboardShouldPersistTaps="handled" nestedScrollEnabled={true}>
189+
<ScrollView
190+
keyboardShouldPersistTaps="handled"
191+
nestedScrollEnabled={true}
192+
>
195193
<Text>Fill in your address</Text>
196194
<GooglePlacesTextInput
197195
apiKey="YOUR_GOOGLE_PLACES_API_KEY"
@@ -201,44 +199,43 @@ const PlaceDetailsExample = () => {
201199
/>
202200
</ScrollView>
203201
```
204-
205202
</details>
206203

207204
## Props
208205

209-
| Prop | Type | Required | Default | Description |
210-
| ------------------------------- | -------------------------------------------------------------- | -------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
211-
| **Basic Configuration** |
212-
| apiKey | string | Yes | - | Your Google Places API key |
213-
| value | string | No | - | Controlled input value |
214-
| placeHolderText | string | No | - | Placeholder text for the input |
215-
| onPlaceSelect | (place: Place, sessionToken?: string) => void | Yes | - | Callback when a place is selected |
216-
| onTextChange | (text: string) => void | No | - | Callback when input text changes |
217-
| onFocus | (event: NativeSyntheticEvent<TextInputFocusEventData>) => void | No | - | Callback when input is focused |
218-
| onBlur | (event: NativeSyntheticEvent<TextInputFocusEventData>) => void | No | - | Callback when input is blurred |
219-
| **Search Configuration** |
220-
| proxyUrl | string | No | - | Custom proxy URL for API requests (Required for Expo web) |
221-
| languageCode | string | No | - | Language code (e.g., 'en', 'fr') |
222-
| includedRegionCodes | string[] | No | - | Array of region codes to filter results |
223-
| types | string[] | No | [] | Array of place types to filter |
224-
| biasPrefixText | (text: string) => string | No | - | Optional function to modify the input text before sending to the Places API |
225-
| minCharsToFetch | number | No | 1 | Minimum characters before triggering search |
226-
| debounceDelay | number | No | 200 | Delay in milliseconds before triggering search |
206+
| Prop | Type | Required | Default | Description |
207+
|------|------|----------|---------|-------------|
208+
| **Basic Configuration** |
209+
| apiKey | string | Yes | - | Your Google Places API key |
210+
| value | string | No | - | Controlled input value |
211+
| placeHolderText | string | No | - | Placeholder text for the input |
212+
| onPlaceSelect | (place: Place, sessionToken?: string) => void | Yes | - | Callback when a place is selected |
213+
| onTextChange | (text: string) => void | No | - | Callback when input text changes |
214+
| onFocus | (event: NativeSyntheticEvent<TextInputFocusEventData>) => void | No | - | Callback when input is focused |
215+
| onBlur | (event: NativeSyntheticEvent<TextInputFocusEventData>) => void | No | - | Callback when input is blurred |
216+
| **Search Configuration** |
217+
| proxyUrl | string | No | - | Custom proxy URL for API requests (Required for Expo web) |
218+
| languageCode | string | No | - | Language code (e.g., 'en', 'fr') |
219+
| includedRegionCodes | string[] | No | - | Array of region codes to filter results |
220+
| types | string[] | No | [] | Array of place types to filter |
221+
| biasPrefixText | (text: string) => string | No | - | Optional function to modify the input text before sending to the Places API |
222+
| minCharsToFetch | number | No | 1 | Minimum characters before triggering search |
223+
| debounceDelay | number | No | 200 | Delay in milliseconds before triggering search |
227224
| **Place Details Configuration** |
228-
| fetchDetails | boolean | No | false | Automatically fetch place details when a place is selected |
229-
| detailsProxyUrl | string | No | null | Custom proxy URL for place details requests (Required on Expo web) |
230-
| detailsFields | string[] | No | ['displayName', 'formattedAddress', 'location', 'id'] | Array of fields to include in the place details response. see [Valid Fields](https://developers.google.com/maps/documentation/places/web-service/place-details#fieldmask) |
231-
| **UI Customization** |
232-
| showLoadingIndicator | boolean | No | true | Show loading spinner during API requests |
233-
| showClearButton | boolean | No | true | Show clear (×) button when input has text |
234-
| forceRTL | boolean | No | - | Force RTL layout (auto-detected if not provided) |
235-
| style | GooglePlacesTextInputStyles | No | {} | Custom styling object |
236-
| hideOnKeyboardDismiss | boolean | No | false | Hide suggestions when keyboard is dismissed |
237-
| scrollEnabled | boolean | No | true | Enable/disable scrolling in the suggestions list |
238-
| nestedScrollEnabled | boolean | No | true | Enable/disable nested scrolling for the suggestions list |
239-
| **Error Handling & Debugging** |
240-
| onError | (error: any) => void | No | - | Callback when API errors occur |
241-
| enableDebug | boolean | No | false | Enable detailed console logging for troubleshooting |
225+
| fetchDetails | boolean | No | false | Automatically fetch place details when a place is selected |
226+
| detailsProxyUrl | string | No | null | Custom proxy URL for place details requests (Required on Expo web)|
227+
| detailsFields | string[] | No | ['displayName', 'formattedAddress', 'location', 'id'] | Array of fields to include in the place details response. see [Valid Fields](https://developers.google.com/maps/documentation/places/web-service/place-details#fieldmask) |
228+
| **UI Customization** |
229+
| showLoadingIndicator | boolean | No | true | Show loading spinner during API requests |
230+
| showClearButton | boolean | No | true | Show clear (×) button when input has text |
231+
| forceRTL | boolean | No | - | Force RTL layout (auto-detected if not provided) |
232+
| style | GooglePlacesTextInputStyles | No | {} | Custom styling object |
233+
| hideOnKeyboardDismiss | boolean | No | false | Hide suggestions when keyboard is dismissed |
234+
| scrollEnabled | boolean | No | true | Enable/disable scrolling in the suggestions list |
235+
| nestedScrollEnabled | boolean | No | true | Enable/disable nested scrolling for the suggestions list |
236+
| **Error Handling & Debugging** |
237+
| onError | (error: any) => void | No | - | Callback when API errors occur |
238+
| enableDebug | boolean | No | false | Enable detailed console logging for troubleshooting |
242239

243240
## Place Details Fetching
244241

@@ -254,7 +251,6 @@ You can automatically fetch detailed place information when a user selects a pla
254251
```
255252

256253
When `fetchDetails` is enabled:
257-
258254
1. The component fetches place details immediately when a user selects a place suggestion
259255
2. The details are attached to the place object passed to your `onPlaceSelect` callback in the `details` property
260256
3. Use the `detailsFields` prop to specify which fields to include in the response, reducing API costs
@@ -325,7 +321,7 @@ type Styles = {
325321
placeholder?: {
326322
color?: string;
327323
};
328-
};
324+
}
329325
```
330326
331327
For detailed styling examples and a complete guide, see our [Styling Guide](./docs/styling-guide.md).
@@ -342,4 +338,4 @@ MIT
342338
343339
Written by Amit Palomo
344340
345-
Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
341+
Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)

0 commit comments

Comments
 (0)