jacob.liu Posted February 15, 2021 Share Posted February 15, 2021 const setStoryContent = (sectionId) => { console.log("old description:", description, "------------------------new description: ", data.story[sectionId].description); setDescription(data.story[sectionId].description); }; //create scroll triggers for text panels ScrollTrigger.create({ trigger: container, start: descStPx[idx] === 0 ? "top top" : descStPx[idx], end: "+=" + steps.length * PXS_PER_STEP, onEnter: () => setStoryContent(idx), }); ideally, console should be "A", "B" "B", "C" "C", "D" but current console log shows "A", "B" "A", "C" "A", "D" old description doesn't update,,, what's the issue? Link to comment Share on other sites More sharing options...
ZachSaucier Posted February 15, 2021 Share Posted February 15, 2021 Hey Jacob. Can you please create a minimal demo of the issue using something like CodePen or CodeSandbox? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now