Using DataPicker

Manuel Martin Jukisz
1 min readJul 23, 2020

Easy steps to have your input data as a calendar.

I have used Datapicker for my project and the documentation its fine but the problem for me was to find the full installation of it. Everywhare tells you that you can use (npm install react-datepicker — save) to have it but there was no css to it.

This are the 3 steps that you have to do to have a full funtional and good looking calendar input on your react projects.

1- Installation

The package can be installed via NPM:

npm install react-datepicker --save

Or by using Yarn:

yarn add react-datepicker

2-On your App.js add:

import 'bootstrap/dist/css/bootstrap.min.css'

3- Just use the codumentation to add the code you need for your app.

You can use the default one which is ok for something simple:

() => {
/const [startDate, setStartDate] = useState(new Date());
return (
<DatePicker selected={startDate} onChange={date => setStartDate(date)} />
);
};

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet

Write a response