# Why are the parameters newProps, newState? What is new about them?

**URL:** <https://forum.kirupa.com/t/why-are-the-parameters-newprops-newstate-what-is-new-about-them/640949>\
**Category:** programming\
**Created:** [October 27, 2019, 12:49pm UTC](https://forum.kirupa.com/t/why-are-the-parameters-newprops-newstate-what-is-new-about-them/640949 "2019-10-27T12:49:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jesse\_Liberty](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jesse_liberty/32/10304_2.png) [@Jesse\_Liberty](https://forum.kirupa.com/u/Jesse_Liberty)\
**Post date:** [October 27, 2019, 12:49pm UTC](https://forum.kirupa.com/t/why-are-the-parameters-newprops-newstate-what-is-new-about-them/640949/1 "2019-10-27T12:49:36Z")

</div>

```
    shouldComponentUpdate(newProps, newState) {

```

Why are these parameters “new” when they contain the same state as is in the Component?

---

<div class="post-metadata">

**Author:** ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)\
**Post date:** [October 27, 2019, 2:20pm UTC](https://forum.kirupa.com/t/why-are-the-parameters-newprops-newstate-what-is-new-about-them/640949/2 "2019-10-27T14:20:32Z")

</div>

`shouldComponentUpdate` runs when a component gets updated or is about to render again. Updates are defined by changes in the component’s props or state, but a call to `shouldComponentUpdate` can also come as the result of a parent component getting updated and then rendering its children, even if that parent is not changing the props to its children.

If `shouldComponentUpdate` is getting called and `newProps` and `newState` haven’t changed, then the update isn’t coming from this component, rather as a result the parent component is getting rendered (probably because its props or state changed) and is now rendering its children.

Generally, if your props or state don’t change, you don’t need the component to render. React provides a version of `Component` called `PureComponent` that automatically does this check - automatically providing an implementation for `shouldComponentUpdate` - and skips rendering of the component if this is the case.

```auto
class MyComponent extends PureComponent { 
  // ... does not render unless props or state changes ...
}

```

[https://jsfiddle.net/ao7qh2u8/](https://jsfiddle.net/ao7qh2u8/)

---

<div class="post-metadata">

**Author:** ![Jesse\_Liberty](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jesse_liberty/32/10304_2.png) [@Jesse\_Liberty](https://forum.kirupa.com/u/Jesse_Liberty)\
**Post date:** [October 27, 2019, 3:47pm UTC](https://forum.kirupa.com/t/why-are-the-parameters-newprops-newstate-what-is-new-about-them/640949/3 "2019-10-27T15:47:40Z")

</div>

Thanks!!
