What’s React?

React is a opensource JavaScript library used for building user interface built by facebook. Every developer asked a question why react called library why not framework? So, let’s explore them.

React called library because it’s not a complete solution like any kind of framework. You will often used more library in react. That’s means we used other library in react whether a framework doesn’t support. Every framework has own codebase that’s you must be used. For experienced developer who work’s on large codebase, framework are deal-breaker.

What’s React State?

state is current moment of UI’s .e.g: If you browse facebook you saw (something) friends on online. it’s doesn’t worry when they come but it’s shows the current situation or moment on user interface.

What’s React Component?

React is nothing but also a component. Component is a piece of UI’’s. Merging every components makes a proper website. Component is reusable, composable and stateful.

What’s JSX?

JSX is stands for JavaScript extension. JSX means html in javascript . In react what we write, it’s called jsx. JSX elements must be on block scope.

JavaScript expression:

any JavaScript statement inside curly brackets called jsx expression. You can’t write if-else state on jsx but ternary operator is okay that means anything returns a value is valid for react JSX expression.

Class component:

class component also called as a stateful component. class is a feature of modern javascript. To create component using class first we need to extends class from Component class. Then we use render method which returns the element that represent the output of an object instantiated from the component.

Functional component:

Create component using function it’s called functional component. functional component also called as a stateless component.

props:

props is a special keyword in React. props stands for properties which is used for passing data from one component to another. Using props data passed in a uni-directional way that means parent component to child component.

events in react:

At first we have to know that what is event? Event is an object which only trigger when something special happens and returns an object to listener which contains information related on that event. e:g: button click, form submission, mouse enter, mouse leave etc.

Event is the only way to interact with users and get users feedback. That means when we called an event it’s interact with users and application understand that user what wanted.

form in react:

a hook is function that can let you inside a React state and lifecycle features. To use form in react first we need to declare a state where information will be set then we use onChange event.

happy coding :)