Create the react element with JSX and Implement Click event in React App
In previous article we discussed how to create react app from scratch and we also discussed about the project structure of the react app.In this article i will be discussing about the how to create the react element with JSX and how to implement Click event in React App. Create the react element with JSX: In app.js file i will remove the default code returned in the App() method and add the following code. App.Js import logo from './logo.svg'; import './App.css'; function App() { return ( <span>Hello world!</span> ) } export default App; then run the below command: npm start You will get the below output in browser. now i try to add another span then the below error will be shown in VS Code: this error is because in react you should have one parent element and under that you can have unlimited child elements. So you need to add the parent div element under that you can add both the span like below example