Quickupdate

  • Home
  • Top Trending
    • Top Android Apps
    • Top Ios Apps
  • Featured
  • About Us
  • Contact us
  • Privacy Policy and Disclaimer

Thursday, 24 June 2021

Important Topics in React js

 Developers     June 24, 2021     React     No comments   

  1. Javascript map function
  2. State, Hooks
  3. What is Super() in React js?
  4. What is the Difference Between the build version & the dev version of the React js?
  5. How to Host React app on Heroku?
  6. What is Axios?
  7. Store UserID, token, username in LocalStorage.


2) What is a State in React js?

  1. A state is a JavaScript object that stores a component’s dynamic data and it enables a component to keep track of changes between renders. 

  2. Because the state is dynamic, it is reserved only for interactivity so you don’t use it for static React projects.

  3. The state is managed within the component (similar to variables declared within a function)

  4. The state is an instance of React Component Class can be defined as an object of a set of observable properties that control the behavior of the component
  5. The state object is where you store property values that belong to the component.

  6. When the state object changes, the component re-renders.

  7. Refer to the state object anywhere in the component by using the this.state.propertyname syntax:

  8. States can only be used in Class Components.

  9. A state is an observable object that is to be used to hold data that may change over time and to control the behavior after each change.

What is a hook in React js?

Examples are 

  1. Hooks are a special function that allows you to connect with react features.

  2. Hooks don’t work inside classes. But you can use them instead of writing class.

  3. React provides a few built-in Hooks like useState, useEffect.

  4. We can also create our own hook to reuse stateful behavior between different components.

  5. Hooks let you use state & other react features without writing a class.

  6. useState is a hook that lets you add `React state` to the function component. previously you can only use state with class components.

When would I use a Hook? If you write a function component and realize you need to add some state to it, previously you had to convert it to a class. Now you can use a Hook inside the existing function component.


Must Read: https://reactjs.org/docs/hooks-state.html#declaring-a-state-variable

What is useState Hook?

  1. useState hook is used to declare the state variables into the functionals component.

  2. useState is a new way to use the exact same capabilities in a `function` that this.state provides in a `class`.

Difference between build version & Production version of Reactjs

  1. By default, React includes many helpful warnings. These warnings are very useful in development. However, they make React larger and slower so you should make sure to use the production version when you deploy the app
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Email ThisBlogThis!Share to XShare to Facebook
Newer Post Older Post Home

0 comments:

Post a Comment

Popular Posts

  • How to upload the existing folder on GitHub Or GitLab?
    These are the steps to upload the existing folder on GitHub Or GitLab. Whenever you want to push your existing folder to git or GitHub you m...

Categories

  • FAANG (2)
  • Javascript (6)
  • Node (1)
  • Project Management (1)
  • React (9)
  • SQL (1)
  • Testing (1)

Blog Archive

  • January 2023 (1)
  • January 2022 (1)
  • November 2021 (3)
  • October 2021 (3)
  • August 2021 (1)
  • July 2021 (7)
  • June 2021 (12)
  • February 2021 (1)
  • January 2021 (1)
  • January 2020 (3)
  • August 2019 (3)