Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

react
basics

Hello World in React

Educative Answers Team

The first step to getting familiar with a new language is to write a simple “Hello World” program. React JS is an open-source JavaScript library for building user interfaces (usually for single-page applications).

svg viewer

Code

In the code below, you need to import React by using this command:

import React from `react`

Then, import ReactDOM for the render() function in which the HTML code is specified.

A style sheet can be used for the specified HTML code as well.

import React from 'react';
require('./style.css');

import ReactDOM from 'react-dom';


ReactDOM.render(
  <p>HelloWorld!</p>,
  document.getElementById('root')
);

RELATED TAGS

react
basics
Copyright ©2022 Educative, Inc. All rights reserved
RELATED COURSES

View all Courses

Keep Exploring