Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Security Solution] Use a stable reference for tour context value (#1…
…60487) ## Summary The TourContext value was a const object declared in the render of a component, which meant it was referentially different on every render, this context provider is so high up in the component tree, this is a problem and causing some re-renders. Many ways to fix this, but I opted for something that kept the code as close to the existing code as I could. A library like why-did-you-render will catch this, also eslint will if you just try to log the value of context in a useEffect like below: <img width="1182" alt="image" src="https://github.com/elastic/kibana/assets/56408403/64a5c8d3-24f9-4918-a9ba-fc36bbc0b671"> Nothing should change from a functionality/user perspective.
- Loading branch information