SPRINT MEN'S

Price: 3106

SPORTS SHOE

Price: 3381

SPRINT WOMEN'S

Price: 1053

FLY KNIT

Price: 3159

VENTURINI MEN'S

Price: 1275

CHELSEA BOOT

Price: 442

CLOSE SANDAL

Price: 2710

MEN'S CANVAS

Price: 1620

MEN'S SANDAL

Price: 3646

SPRINT MEN'S

Price: 2495

SPORTS SANDAL

Price: 3513

SELECT SHOES

HOW REACT WORKS

React is a declarative, efficient, and flexible JavaScript library for building user interfaces. It lets you compose complex UIs from small and isolated pieces of code called “components”

Basically react creates a virtual DOM and Instead of manipulating the browser's DOM directly. Virtual DOM is react object and Browser DOM is browser object.React allows you to effectively re-construct your DOM in JavaScript and push only those changes to the DOM which have actually occurred. where it does all the necessary manipulating, before making the changes in the browser DOM. then changes only what needs to be changed.

difference between state and props
State
  • States are mutable
  • State use inside a class component
  • Which lets React do fast reference checks
  • States are associated with the individual components can't be used by other components.
  • States are initialize on component mount.
  • States are used for rendering dynamic changes within component.
Props
  • Represents "read-only" data, that are immutable and refer to attributes from parents component.
  • Props are immutable.
  • you can pass props between components.
  • Props use to pass data in the child component
  • Props change a value outside a component(child component)
HOW useState WORKS

Mainly State allows us to manage changing data in an application. It's defined as an object where we define key-value pairs specifying various data we want to track in the application.

useState is a Hook that allows you to have state variables in functional components. You pass the initial state to this function and it returns a variable with the current state value (not necessarily the initial state) and another function to update this value.

useState enables you to add state to function components. Calling React.useState inside a function component generates a single piece of state associated with that component.

  • useState is one of build-in react hooks available in 0.16.7 version.
  • useState should be used only inside functional components. useState is the way if we need an internal state and don't need to implement more complex logic such as lifecycle methods.
Syntax

const [state, setState] = useState(initialState);