Intro to React Select pt. 1

Today is the first part of my series on React Select. This intro is perfect if you are completely new to React Select or React in general.

Setting things up

I started by setting up a base project using create-react-app. I called my app “d…


This content originally appeared on DEV Community and was authored by Cathy Casey-Richards

Today is the first part of my series on React Select. This intro is perfect if you are completely new to React Select or React in general.

Setting things up

I started by setting up a base project using create-react-app. I called my app "demo-app".
npm create-react-app demo-app

Once my app is ready to use, I installed React Select and got to work!
npm i --save react-select

Utilizing React Select

Now that I have React Select installed, I can begin to use it by importing it and referencing it.
A simple implementation of React Select with a placeholder

Adding Options

Next, we can add an option to the select in the format of:
{ value: 'value1', label: 'Label 1'}
Now the React Select has a single option

Now that we have a simple implementation ready, I used GitKraken to view & commit my changes.

And there you have it! Keep an eye out for my follow-up articles that show you more advanced usages of React Select.

You can view of video walkthrough of this on YouTube!


This content originally appeared on DEV Community and was authored by Cathy Casey-Richards


Print Share Comment Cite Upload Translate Updates
APA

Cathy Casey-Richards | Sciencx (2021-06-26T19:17:11+00:00) Intro to React Select pt. 1. Retrieved from https://www.scien.cx/2021/06/26/intro-to-react-select-pt-1/

MLA
" » Intro to React Select pt. 1." Cathy Casey-Richards | Sciencx - Saturday June 26, 2021, https://www.scien.cx/2021/06/26/intro-to-react-select-pt-1/
HARVARD
Cathy Casey-Richards | Sciencx Saturday June 26, 2021 » Intro to React Select pt. 1., viewed ,<https://www.scien.cx/2021/06/26/intro-to-react-select-pt-1/>
VANCOUVER
Cathy Casey-Richards | Sciencx - » Intro to React Select pt. 1. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/06/26/intro-to-react-select-pt-1/
CHICAGO
" » Intro to React Select pt. 1." Cathy Casey-Richards | Sciencx - Accessed . https://www.scien.cx/2021/06/26/intro-to-react-select-pt-1/
IEEE
" » Intro to React Select pt. 1." Cathy Casey-Richards | Sciencx [Online]. Available: https://www.scien.cx/2021/06/26/intro-to-react-select-pt-1/. [Accessed: ]
rf:citation
» Intro to React Select pt. 1 | Cathy Casey-Richards | Sciencx | https://www.scien.cx/2021/06/26/intro-to-react-select-pt-1/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.