File tree Expand file tree Collapse file tree 3 files changed +48
-0
lines changed
Expand file tree Collapse file tree 3 files changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -376,6 +376,22 @@ A callback that gets called when search bar has lost focus.
376376
377377A callback that gets called when the cancel button is pressed.
378378
379+ ##### ` onSearchButtonPress `
380+
381+ A callback that gets called when the search button is pressed.
382+
383+ ``` js
384+ const [search , setSearch ] = React .useState (' ' );
385+
386+ React .useLayoutEffect (() => {
387+ navigation .setOptions ({
388+ headerSearchBarOptions: {
389+ onSearchButtonPress : (event ) => setSearch (event ? .nativeEvent ? .text ),
390+ },
391+ });
392+ }, [navigation]);
393+ ` ` `
394+
379395##### ` onChangeText`
380396
381397A callback that gets called when the text changes. It receives the current text value of the search bar.
Original file line number Diff line number Diff line change @@ -1249,6 +1249,22 @@ A callback that gets called when search bar has lost focus.
12491249
12501250A callback that gets called when the cancel button is pressed.
12511251
1252+ ##### ` onSearchButtonPress `
1253+
1254+ A callback that gets called when the search button is pressed.
1255+
1256+ ``` js
1257+ const [search , setSearch ] = React .useState (' ' );
1258+
1259+ React .useLayoutEffect (() => {
1260+ navigation .setOptions ({
1261+ headerSearchBarOptions: {
1262+ onSearchButtonPress : (event ) => setSearch (event ? .nativeEvent ? .text ),
1263+ },
1264+ });
1265+ }, [navigation]);
1266+ ` ` `
1267+
12521268##### ` onChangeText`
12531269
12541270A callback that gets called when the text changes. It receives the current text value of the search bar.
Original file line number Diff line number Diff line change @@ -1252,6 +1252,22 @@ A callback that gets called when search bar has lost focus.
12521252
12531253A callback that gets called when the cancel button is pressed.
12541254
1255+ ##### ` onSearchButtonPress `
1256+
1257+ A callback that gets called when the search button is pressed.
1258+
1259+ ``` js
1260+ const [search , setSearch ] = React .useState (' ' );
1261+
1262+ React .useLayoutEffect (() => {
1263+ navigation .setOptions ({
1264+ headerSearchBarOptions: {
1265+ onSearchButtonPress : (event ) => setSearch (event ? .nativeEvent ? .text ),
1266+ },
1267+ });
1268+ }, [navigation]);
1269+ ` ` `
1270+
12551271##### ` onChange`
12561272
12571273A callback that gets called when the text changes. It receives en event containing the current text value of the search bar.
You can’t perform that action at this time.
0 commit comments