refactor: simplify example usage of SingleDatePicker in README.md
Some checks failed
Publish to npm / publish (push) Has been cancelled

This commit is contained in:
Astrian Zheng 2025-02-23 10:00:43 +11:00
parent 9e52309f0b
commit 7a43085c6f
Signed by: Astrian
SSH Key Fingerprint: SHA256:rVnhx3DAKjujCwWE13aDl7uV6+9U1MvydLkNRXJrBiA

View File

@ -33,7 +33,6 @@ yarn add datenel-react # Use yarn
Here is an example of how to use Datenel in your React application:
```tsx
import React from 'react'
import { SingleDatePicker } from 'datenel-react'
export default () => {
@ -41,23 +40,19 @@ export default () => {
alert(`You selected ${value.year}-${value-month}-${value.day}`)
}
return (
<div className='app'>
<div className="border">
<SingleDatePicker
value={{
year: 2025,
month: 1,
day: 1
}}
onSelect={onSelect}
/>
</div>
</div>
)
return <SingleDatePicker
value={{
year: 2025,
month: 1,
day: 1
}}
onSelect={onSelect}
/>
}
```
For more information and live demo, refer to [Datenels documentation](https://datenel.js.org/guide/react/gettingstart.html).
## Supported Components & Props
- [x] SingleDatePicker