refactor(5589): image in View state management
Description
This PR fixes #5589
Notes for Reviewers Refactored image in view state handling for css or image toggle
- [ ] Yes, I signed my commits.
🚀 Preview for commit 688173f9edf54e0635cd703f803f743d16a69aff at: https://6676d8f683621c96583739db--layer5.netlify.app
HI @sudhanshutech , ideally that state should be in useEffect, but as I analyze the code, we are creating new state just to maintain status of inView state and using that in our code. so, instead of adding new state we can directly use inView state in our code. So, I have removed that additional state management code and directly used inView state. Thanks
@surajgjadhav Thank you for your contribution. Let's discuss this on Websites's call on Monday. Adding this as an agenda item into the meeting minutes.
@sudhanshutech @vishalvivekm do we need this refactor?