How to create Emoji Picker in ReactJS ?
Approach: To create our Spreadsheet we are going to use the emoji-picker-react package because it is powerful, lightweight, and fully customizable. After that, we will add an emoji picker on our homepage using the installed package.
Create ReactJs Application: You can create a new ReactJs project using the below command:
npx create-react-app gfg
Module Installation: Install the emoji-picker-react package using the below command:
npm i emoji-picker-react
Project Structure: It will look like this.
Filename: App.js In this example, we are going to add the emoji picker on the homepage of our app using the package that we installed. For this, add the below content in the App.js file.
Explanation: In the above example first, we are importing the Picker component from the emoji-picker-react package. After that, we are using our useState to add the initial data and update the emoji. Then we are adding our Emoji PIcker using the Picker component.
Steps to run the application: Run the below command in the terminal to run the app.