From fe09fdbc30c1ffb6ecd31d2e7b5febdea9786368 Mon Sep 17 00:00:00 2001 From: smokiebacon <37253660+smokiebacon@users.noreply.github.com> Date: Sun, 10 Mar 2019 04:18:37 -0700 Subject: [PATCH] added a tiny explanation of constructor(props) (#32279) * added a tiny explanation of constructor(props) * Formatted properly --- guide/english/react/hello-world/index.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/guide/english/react/hello-world/index.md b/guide/english/react/hello-world/index.md index e8a4f7a6c4..6ce40f61de 100644 --- a/guide/english/react/hello-world/index.md +++ b/guide/english/react/hello-world/index.md @@ -56,6 +56,14 @@ copy the code below and paste it into src/App.js export default App; ``` If we check the index.js file in the src folder, we find that the above App.js is called into index.js and then rendered. +The code may look cryptic, especially part with: +```jsx +constructor(props) { + super(props); +} +``` +Don't worry about it now. Just know that Class components should always call the base constructor with props and will be useful later when using the 'this' code. + ```javascript // Other code