Edit: I found the solution to this! See my answer below.
So essentially, I have a slice of state that is updating but not triggering the useEffect that has it as a dependency:
const [editableParticipants, setEditableParticipants] = useState(*initial value*);
const [joinLeftTimeState, setJoinLeftTimeState] = useState(*initial value*);
function addParticipant(newParticipant) {
setEditableParticipants([
...editableParticipants,
newParticipant
])
}
useEffect(() => {
setJoinLeftTimeState(
editableParticipants.map(*mapping stuff*)
);
}, [editableParticipants]);
When addParticipant is triggered, editableParticipants is successfully updating but the effect isn't running, leaving joinLeftTimeState without an entry for the new participant. I put a console log in the effect itself, it's not triggering at all after addParticipant runs. What the heck?