Skip to content

Conversation

@KrumTy
Copy link
Collaborator

@KrumTy KrumTy commented Oct 29, 2025

Description

Issue:
We currently cannot navigate outside of react lifecycle/hooks. E.g. if we want to navigate from a method, we need to call const history = useHistory() in a component and somehow pass the history as a prop.
Use case - we have a lot of cells in a table and we don't want to call useHistory for each one of them if we can access the object directly.

Solution:

  • BrowserRouter is wrapper over ReactRouter that sets up history under the hook, so the new implementation should behave identically, only we have access to the history object outside of react hooks
  • history from the store and test-store was not used, so I removed those


const riConfig = getConfig()

export const history = createBrowserHistory()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was not used and also it creates another instance - not the one from BrowserRouter, so it's also useless

@github-actions
Copy link
Contributor

Code Coverage - Frontend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 82.21% 20140/24497
🟡 Branches 67.65% 8721/12892
🟡 Functions 76.34% 5357/7017
🟢 Lines 82.63% 19719/23864

Test suite run success

5229 tests passing in 681 suites.

Report generated by 🧪jest coverage report action from 492a5dc

@KrumTy KrumTy merged commit 0d882bf into main Oct 30, 2025
18 checks passed
@KrumTy KrumTy deleted the fe/feature/expose-history branch October 30, 2025 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants