Skip to content

Commit 9c3f7f2

Browse files
authored
fix: explicit passing Dropdown props to prevent maximum update depth (#166)
* fix: explicit passing Dropdown props to prevent maximum update depth * chore: update README links * fix: explicit passing Dropdown props to prevent maximum update depth * chore: change props order
1 parent 805f484 commit 9c3f7f2

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ No additional steps are necessary
7777

7878
## Usage
7979

80-
Wrap your root component in `AutocompleteDropdownContextProvider` from `react-native-autocomplete-dropdown` as you can see in [example](https://github.com/onmotion/react-native-autocomplete-dropdown/blob/main/example/App.js)
80+
Wrap your root component in `AutocompleteDropdownContextProvider` from `react-native-autocomplete-dropdown` as you can see in [example](https://github.com/onmotion/react-native-autocomplete-dropdown/blob/main/example/App.tsx)
8181

8282
```js
8383
<AutocompleteDropdownContextProvider>

README^2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ export const RemoteDataSetExample2 = memo(() => {
208208

209209
```
210210

211-
More examples see at <https://github.com/onmotion/react-native-autocomplete-dropdown/tree/main/example>
211+
More examples see at <https://github.com/onmotion/react-native-autocomplete-dropdown/tree/2.1.1/example>
212212

213213
Run
214214

README^3.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ No additional steps are necessary
7777

7878
## Usage
7979

80-
Wrap your root component in `AutocompleteDropdownContextProvider` from `react-native-autocomplete-dropdown` as you can see in [example](https://github.com/onmotion/react-native-autocomplete-dropdown/blob/main/example/App.js)
80+
Wrap your root component in `AutocompleteDropdownContextProvider` from `react-native-autocomplete-dropdown` as you can see in [example](https://github.com/onmotion/react-native-autocomplete-dropdown/blob/3.1.5/example/App.tsx)
8181

8282
```js
8383
<AutocompleteDropdownContextProvider>
@@ -245,7 +245,7 @@ export const RemoteDataSetExample2 = memo(() => {
245245

246246
```
247247

248-
More examples see at <https://github.com/onmotion/react-native-autocomplete-dropdown/tree/main/example>
248+
More examples see at <https://github.com/onmotion/react-native-autocomplete-dropdown/tree/3.1.5/example>
249249

250250
## Playground
251251

src/index.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -461,15 +461,15 @@ export const AutocompleteDropdown = memo<
461461

462462
setContent(
463463
<Dropdown
464-
{...{
465-
...props,
466-
direction,
467-
inputHeight,
468-
dataSet,
469-
suggestionsListMaxHeight,
470-
renderItem,
471-
ListEmptyComponent,
472-
}}
464+
dataSet={dataSet}
465+
direction={direction}
466+
flatListProps={props.flatListProps}
467+
inputHeight={inputHeight}
468+
suggestionsListContainerStyle={props.suggestionsListContainerStyle}
469+
suggestionsListMaxHeight={suggestionsListMaxHeight}
470+
renderItem={renderItem}
471+
ItemSeparatorComponent={props.ItemSeparatorComponent}
472+
ListEmptyComponent={ListEmptyComponent}
473473
/>,
474474
)
475475
} else {
@@ -482,7 +482,9 @@ export const AutocompleteDropdown = memo<
482482
direction,
483483
inputHeight,
484484
isOpened,
485-
props,
485+
props.suggestionsListContainerStyle,
486+
props.flatListProps,
487+
props.ItemSeparatorComponent,
486488
renderItem,
487489
setContent,
488490
suggestionsListMaxHeight,

0 commit comments

Comments
 (0)