@jobber/components-native 0.82.1-JOB-131123-ed033d6.44 → 0.84.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components-native",
3
- "version": "0.82.1-JOB-131123-ed033d6.44+ed033d62",
3
+ "version": "0.84.0",
4
4
  "license": "MIT",
5
5
  "description": "React Native implementation of Atlantis",
6
6
  "repository": {
@@ -79,5 +79,5 @@
79
79
  "react-native-safe-area-context": "^5.4.0",
80
80
  "react-native-svg": ">=12.0.0"
81
81
  },
82
- "gitHead": "ed033d620aaac6d0add74f60e72caf869d4bdcf5"
82
+ "gitHead": "5fcbf313b34c60eb45e8985527acb880421690e3"
83
83
  }
@@ -11,18 +11,17 @@ var __rest = (this && this.__rest) || function (s, e) {
11
11
  };
12
12
  import React, { forwardRef, useEffect } from "react";
13
13
  import { View } from "react-native";
14
- import debounce from "lodash/debounce";
14
+ import { useDebounce } from "@jobber/hooks/useDebounce";
15
15
  import { styles } from "./InputSearch.style";
16
16
  import { InputText } from "../InputText";
17
17
  export const InputSearch = forwardRef(SearchInputInternal);
18
18
  function SearchInputInternal(_a, ref) {
19
19
  var { onChange, onDebouncedChange, wait = 300, value } = _a, inputTextProps = __rest(_a, ["onChange", "onDebouncedChange", "wait", "value"]);
20
- const delayedSearch = debounce(onDebouncedChange, wait);
20
+ const debouncedSearch = useDebounce(onDebouncedChange, wait);
21
21
  const handleChange = (newValue = "") => onChange(newValue);
22
22
  useEffect(() => {
23
- delayedSearch(value);
24
- return delayedSearch.cancel;
25
- }, [value, delayedSearch]);
23
+ debouncedSearch(value);
24
+ }, [value, debouncedSearch]);
26
25
  return (React.createElement(View, { style: styles.container },
27
26
  React.createElement(InputText, Object.assign({}, inputTextProps, { autoCorrect: false, onChangeText: handleChange, ref: ref, value: value }))));
28
27
  }