Interactive comment section with React, Tailwind CSS and Redux Toolkit

Solution retrospective
These code snippets came to my rescue after hours of brainstorming and debugging
editComment(state, action) { const { index, text, parentIndex } = action.payload; let commentsCopy = [...state.comments]; Number.isInteger(parentIndex) ? (commentsCopy[parentIndex].replies[index].content = text) : (commentsCopy[index].content = text); state.comments = [...commentsCopy]; }
useEffect(() => { if (mode === "reply") { setInput(`@${replyingTo} `); setInputRef(); } }, [mode]);
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on itksweb's solution.
Join our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord