We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First, thank you very much for sharing how to make todolist app in Next.js & supaBase, it help me a lot.
I'm not familiar with React and supaBase, here I have some issue when I followed your tutorial in freeCodeCamp,
I always get error in Chrome console like this webSocket connection to 'wss//.....' failed:
webSocket connection to 'wss//.....' failed:
and i think the error is from these code in index.js
useEffect(() => { const todoListener = supabaseClient .from("todos") .on("*", (payload) => { if (payload.eventType !== "DELETE") { const newTodo = payload.new; setTodos((oldTodos) => { const exists = oldTodos.find((todo) => todo.id === newTodo.id); let newTodos; if (exists) { const oldTodoIndex = oldTodos.findIndex( (obj) => obj.id === newTodo.id ); oldTodos[oldTodoIndex] = newTodo; newTodos = oldTodos; } else { newTodos = [...oldTodos, newTodo]; } newTodos.sort((a, b) => b.id - a.id); return newTodos; }); } }) .subscribe(); return () => { todoListener.unsubscribe(); }; }, []);
but i have no idea to fix it....
because when I update todo or add new todo, it cannot show the new state for todos, i need refresh again to fetch new todos.
thank you.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
First, thank you very much for sharing how to make todolist app in Next.js & supaBase, it help me a lot.
I'm not familiar with React and supaBase, here I have some issue when I followed your tutorial in freeCodeCamp,
I always get error in Chrome console like this
webSocket connection to 'wss//.....' failed:
and i think the error is from these code in index.js
but i have no idea to fix it....
because when I update todo or add new todo, it cannot show the new state for todos, i need refresh again to fetch new todos.
thank you.
The text was updated successfully, but these errors were encountered: