OSDN Git Service

Regular updates
[twpd/master.git] / react.md
index 0f722cb..bca3061 100644 (file)
--- a/react.md
+++ b/react.md
@@ -4,7 +4,7 @@ category: React
 layout: 2017/sheet
 ads: true
 tags: [Featured]
-updated: 2020-07-04
+updated: 2020-07-05
 weight: -10
 keywords:
   - React.Component
@@ -215,8 +215,7 @@ And without constructor using [Babel](https://babeljs.io/) with [proposal-class-
 
 ```jsx
 class Hello extends Component {
-    state = { visible: true }
-  }
+  state = { visible: true }
 }
 ```
 {: data-line="2"}
@@ -282,6 +281,7 @@ Lifecycle
 {: .-two-column}
 
 ### Mounting
+
 | Method                   | Description                                                                                          |
 | ------------------------ | ---------------------------------------------------------------------------------------------------- |
 | `constructor` _(props)_  | Before rendering [#](https://reactjs.org/docs/react-component.html#constructor)                      |
@@ -297,6 +297,7 @@ Set initial the state on `constructor()`.
 Add DOM event handlers, timers (etc) on `componentDidMount()`, then remove them on `componentWillUnmount()`.
 
 ### Updating
+
 | Method                                                  | Description                                          |
 | ------------------------------------------------------- | ---------------------------------------------------- |
 | `componentDidUpdate` _(prevProps, prevState, snapshot)_ | Use `setState()` here, but remember to compare props |