lite-phone-input 0.1.0 → 0.3.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/README.md CHANGED
@@ -55,12 +55,11 @@ const phone = PhoneInput.mount(document.getElementById('phone'), {
55
55
  ### React
56
56
 
57
57
  ```jsx
58
- import { useRef, useState } from 'react';
58
+ import { useRef } from 'react';
59
59
  import { PhoneInput } from 'lite-phone-input/react';
60
60
  import 'lite-phone-input/styles';
61
61
 
62
62
  function MyForm() {
63
- const [value, setValue] = useState('');
64
63
  const phoneRef = useRef(null);
65
64
 
66
65
  return (
@@ -68,8 +67,8 @@ function MyForm() {
68
67
  ref={phoneRef}
69
68
  defaultCountry="US"
70
69
  separateDialCode
71
- value={value}
72
- onChange={(e164) => setValue(e164)}
70
+ initialValue="+12025551234"
71
+ onChange={(e164) => console.log(e164)}
73
72
  name="phone"
74
73
  aria-label="Phone number"
75
74
  />
@@ -104,7 +103,7 @@ Same API as React. Uses `preact/hooks` directly — no `preact/compat` required.
104
103
  |---|---|
105
104
  | [Getting Started](docs/getting-started.md) | Installation and first render |
106
105
  | [Vanilla JS Guide](docs/vanilla-guide.md) | Mounting, methods, callbacks |
107
- | [React Guide](docs/react-guide.md) | Controlled/uncontrolled, form libraries |
106
+ | [React Guide](docs/react-guide.md) | Usage, ref methods, form libraries |
108
107
  | [Preact Guide](docs/preact-guide.md) | Preact-specific setup |
109
108
  | [API Reference](docs/api-reference.md) | All options, methods, and types |
110
109
  | [Styling & Theming](docs/styling.md) | CSS variables, BEM classes, dark mode |