Day 11 - Third Day learning React

Today was my third learning React from the udemy course and it is going great I am learning alot from the course. I learned about JSX and how to write code in JSX. React is kind of a framework to work in as you can create custom HTML elements and you them. You can also clone the components in React. The elements are called Components in React. I also learned adding style sheets in React components. I also learned to add dynamic data in React.

Adding Style Sheets in React Components

Add CSS Style sheet

We can import CSS style sheet using this command in to specific component
import './stylesheet.css'
we can also add SCSS style sheet but first we need to Install node-sass, using command :
npm install node-sass
then add the same line to your component in which you want to add style but the extension should be .scss
import './stylesheet.scss'

Adding JavaScript logic in React components

We can add JavaScript in React components by adding the JavaScript logic before the return command. Example :
function myfunc() {
const month = props.date.toLocaleString('en-US',{month: 'long'});
return (

BASIC HTML CODE

);
}

I also learned about children porps in React but I didn't understand it clearly yet. I will be learning form external sources to know more about it more.