native-pytech 1.0.165 → 1.0.167

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.
@@ -1,10 +1,11 @@
1
1
  import { useMemo, memo, useRef, useCallback, useEffect } from "react";
2
2
  import { useValue } from "@legendapp/state/react";
3
- import { SecureField, TextField } from "@expo/ui/swift-ui";
3
+ import { SecureField, TextField, useNativeState } from "@expo/ui/swift-ui";
4
4
  import { keyboardType as keyboardTypeModifier, submitLabel, textInputAutocapitalization, onSubmit } from '@expo/ui/swift-ui/modifiers';
5
5
  import { usePage } from '../../context/page';
6
6
  export default memo(({ itemKey, defaultValue, placeholder, keyboardType, autocapitalization = true, secureTextEntry, isValid, }) => {
7
7
  const { store, registerItem, onSubmit: _onSubmit } = usePage();
8
+ const text = useNativeState(defaultValue ?? '');
8
9
  const isUniqueItem = useValue(() => store.isUniqueItem.get());
9
10
  const ref = useRef(null);
10
11
  // Key
@@ -28,8 +29,8 @@ export default memo(({ itemKey, defaultValue, placeholder, keyboardType, autocap
28
29
  ...(!autocapitalization ? [textInputAutocapitalization('never')] : []),
29
30
  onSubmit(() => _onSubmit(keyRef.current)),
30
31
  ], [keyboardType, autocapitalization, isUniqueItem]);
31
- const props = { autoFocus: isUniqueItem, modifiers, placeholder, defaultValue, onValueChange };
32
+ const props = { ref, text: text, autoFocus: isUniqueItem, modifiers, placeholder, defaultValue, onTextChange: onValueChange };
32
33
  if (secureTextEntry)
33
- return <SecureField {...props} ref={ref}/>;
34
- return <TextField {...props} ref={ref}/>;
34
+ return <SecureField {...props}/>;
35
+ return <TextField {...props}/>;
35
36
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-pytech",
3
- "version": "1.0.165",
3
+ "version": "1.0.167",
4
4
  "description": "Libreria de React Native Pytech",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",