refactor: simplify example usage of SingleDatePicker in README.md
Some checks failed
Publish to npm / publish (push) Has been cancelled
Some checks failed
Publish to npm / publish (push) Has been cancelled
This commit is contained in:
parent
9e52309f0b
commit
7a43085c6f
25
README.md
25
README.md
|
@ -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 [Datenel’s documentation](https://datenel.js.org/guide/react/gettingstart.html).
|
||||||
|
|
||||||
## Supported Components & Props
|
## Supported Components & Props
|
||||||
|
|
||||||
- [x] SingleDatePicker
|
- [x] SingleDatePicker
|
||||||
|
|
Loading…
Reference in New Issue
Block a user