Chapter 3 Laying the foundation
1) What is JSX?
JSX is a like a HTML, but it doesn’t mean that JSX is a HTML inside JavaScript. JSX makes it easier to write and add html in react.
Example: const heading=
.2) Superpowers of JSX?
Using JSX, we can write markup or HTML inside JavaScript, providing us with a superpower to write logic and markup of a component inside a single .jsx file.
3) {TitleComponent} vs {} vs {< /TitleComponent>}
- TitleComponent: It renders React Elements
- {}: Renders the React Functional Component
- {}: In this component we can write another component.
4)Role Of “type” attribute in script tag? Which option can I use there?
The attribute indicates the type of script represent by the element. We can use other options like: text/javascript (this is a default), module or datablock.