Introduction to React JS
JSX stands for JavaScript XML. With the help of JSX we can write HTML in React.
JSX is the extension of javascript. We can use it with React for UI design
1. It performs optimization while compiling code to JavaScript make it faster.
2. Its caught error while writing the code make it type-safe language.
import React from 'react'; class App extends React.Component { render() { return ( <div> Welcome to React JS Website! </div> ); } } export default App;
Output: Welcome to React JS Website!
import React from 'react'; class App extends React.Component { render() { var myStyle = { fontSize: 100, color: '#FF0000' } return ( <div> <h1 style = {myStyle}>Header </h1> </div> ); } } export default App;
Output: Header