React js
React js
Web
Development
Nimra Idrees
Introduction to
React.js
Introduction
• To use a CDN with React Js, include the CDN in your index.html file.
• Using NPM packages helps developers save time by providing access to premade
code instead of having to create code from scratch.
• JSX (JavaScript Extension) is a React extension that allows you to write HTML-like
JavaScript code.
• In other words, JSX is a React-specific HTML-like syntax that extends ECMAScript to allow
HTML-like syntax to coexist with JavaScript/React code.
Props in
React
and Data • After adding the data, now pass the data
through props.
render() {
const Child = (props) => {
return (
return <p>{props.text}</p>;
}; <h1>
<Child
one component to another and text={"Child 2"} />
enable the dynamicity of a React
application. <Child
text={"Child 3"} />
</h1>
);}}
12/09/2024 By Nimra Idrees 17
State Props
State is used to store the Props are used to pass data
Use Case data of the components and event handlers to the
that have to be rendered children components
to the view