programming pointers

JSX in ReactJS: a quick intro with examples

What is JSX file 

More JSX

Examples:

HTML inside JSX -> output: 2 + 3 import React from 'react'; import ReactDOM from 'react-dom'; ReactDOM.render(<h1>2 + 3</h1>,document.getElementById('app'));

JS inside JSX-> output: 5
import React from 'react';     import ReactDOM from 'react-dom';     ReactDOM.render(<h1>{2 + 3}</h1>,document.getElementById('app'));

More about JSX and React on my next post.

Keep learning!

 

 

Copyright © 2007-2020 PRADEEP K. PANT

Made with Jekyll | Source Code | RSS