. Rising Code Challenges Skip to main content

Posts

Showing posts from October, 2019

Use Select2 with using React Hooks in reactjs typescript

Select2 is very popular for create very user friendly dropdown with support for searching, tagging, remote data sets, infinite scrolling, and many other highly used options. Install Select2 From CDN < link href = "https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.10/css/select2.min.css" rel = "stylesheet" /> < script src = "https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.10/js/select2.min.js" > </ script >   From NPM npm install select2 After installation  we just need to put the selector with the html element and beautiful dropdown will created. Simple Js Example: < select class = "js-example-basic-single" name= "state" > <option value = "AL" >Alabama</option> ... <option value = "WY" >Wyoming</option> </ select > $( document ).ready( function ( ) { $( '.js-example-basic-single' ).select2(); }); With React and Typescript But ...