Skip to content
Related Articles

Related Articles

How to concatenate unicode and variable in ReactJS ?

Improve Article
Save Article
Like Article
  • Difficulty Level : Easy
  • Last Updated : 12 Apr, 2021

Unicode: Unicode is an encoding standard for all characters in the universe. Every language code and symbol in this world is assigned by Unicode. There is no encoding standard that supports all languages, By using Unicode standard, we can retrieve and combine data with all language combinations.



In the above example, a right-facing arrow is represented in Unicode by U+2192.

How to create React Application:

  • Step 1: Create a React application using the following command.

     npx create-react-app geeksforgeeks
  • Step 2: After creating your project folder i.e. geeksforgeeks, move to it using the following command.

    cd geeksforgeeks

    Project Structure:

    Folder structure

    How to concatenate Unicode and variable in ReactJS: To concatenate we first convert Unicode into its numerical value and for that, we will use parseInt.


    Now, this numerical value needs to be converted into its character and for that, we can use


    Example: Make the following changes to your App.js file


    import React from 'react'
        const App = ({ unicode }) => {
               This is a Right arrow
    export default App;

    Now import this App.js file in your index.js file(by default it is already being imported) and pass the value of Unicode in the App component.


    import React from 'react';
    import ReactDOM from 'react-dom';
    import App from './App';
           <App unicode='2192'/>

    Now run the local server using the following command within the react-app directory  

    npm start


    My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!