React JS
React JS
eg:
import React from 'react';
function MyComponent() {
return (
<div>
<h1>Hello, Functional Component!</h1>
</div>
);
}
eg:
function App() {
return (
<Router>
<div>
<Route path="/" component={Home} />
<Route path="/about" component={About} />
.......
</div>
</Router>
);
}
React Hooks :
Hooks allow function components to have access to state and other React
features. Because of this, class components are generally no longer needed.
useState
useEffect
useContext
useReducer
useRef
useMemo and useCallback
useLayoutEffect
Custom Hooks
React Conditional Rendering
If Statements and Ternary Operators
Logical && Operator
Conditional Rendering with Function Components
Conditional Rendering with Class Components
Rendering Lists Conditionally
Conditional Rendering with Ternary Operator
Switch Statements for Conditional Rendering
Rendering Components based on State
Thank You!