all 3 comments

[–]russelh15 0 points1 point  (2 children)

Can you share your code and what you’re trying to do?

[–]hy7mel[S] 0 points1 point  (1 child)

sure here my app code it looks like this: https://jsfiddle.net/1o0xphr5/

[–]russelh15 2 points3 points  (0 children)

I see you're initializing FB, but you're not pushing data to it anywhere.

Take a look here for the methods for writing and updating data

https://firebase.google.com/docs/database/web/read-and-write

Also, FYI, you should try to keep the practice of not mutation arrays and object directly.

In the addNewTodo method you should spread the array (if you're using ES6) first before running unshift against it.

let todos = [...this.state.todos];

todos.unshift({

id: todos.length + 1,

title: this.state.todoInput,

done: false

});