Fixed typo: "Calcutor" to "Calculator" (#9047)

This commit is contained in:
Stephie
2017-02-22 17:37:55 +00:00
committed by Dan Abramov
parent 55f18f20ea
commit 5cc2a4fe3e
+1 -1
View File
@@ -172,7 +172,7 @@ However, we want these two inputs to be in sync with each other. When we update
In React, sharing state is accomplished by moving it up to the closest common ancestor of the components that need it. This is called "lifting state up". We will remove the local state from the `TemperatureInput` and move it into the `Calculator` instead.
If the `Calcutor` owns the shared state, it becomes the "source of truth" for the current temperature in both inputs. It can instruct them both to have values that are consistent with each other. Since the props of both `TemperatureInput` components are coming from the same parent `Calculator` component, the two inputs will always be in sync.
If the `Calculator` owns the shared state, it becomes the "source of truth" for the current temperature in both inputs. It can instruct them both to have values that are consistent with each other. Since the props of both `TemperatureInput` components are coming from the same parent `Calculator` component, the two inputs will always be in sync.
Let's see how this works step by step.