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