Ver código fonte

+componentDidMount

ilya_shyian 2 anos atrás
pai
commit
ef9a3e7932
1 arquivos alterados com 1 adições e 2 exclusões
  1. 1 2
      src/components/TodoList.js

+ 1 - 2
src/components/TodoList.js

@@ -6,14 +6,13 @@ export default class TodoList extends React.Component {
     constructor(props) {
         super(props);
         this.state = { items: [], inputText: "" };
-
         this.handleChange = this.handleChange.bind(this);
         this.handleKeyDown = this.handleKeyDown.bind(this);
         this.addItem = this.addItem.bind(this);
         this.deleteItem = this.deleteItem.bind(this);
         this.completeItem = this.completeItem.bind(this);
     }
-    useEffect() {
+    componentDidMount() {
         getTodoList().then((data) => {
             this.setState({
                 items: data,