Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate osrd to React 19 #10338

Open
5 tasks
SharglutDev opened this issue Jan 13, 2025 · 0 comments
Open
5 tasks

Migrate osrd to React 19 #10338

SharglutDev opened this issue Jan 13, 2025 · 0 comments
Assignees

Comments

@SharglutDev
Copy link
Contributor

SharglutDev commented Jan 13, 2025

Description and goal

React 19 comes with some new functionalities and deprecations that should be addressed.

Deprecations

  • findDOMNode : used in the Map via react-transition-group lib (not updated since 2022) to display the map buttons tooltip
  • defaultProps : used in react-beautiful-dnd lib (which is deprecated and not maintained anymore) to drag and drop vias in itinerary tab
  • forwardRef : ref can now be passed directly into component props

Improvements

  • Context can now be used as a provider without using Context.Provider
  • Context can be consumed by using use instead of useContext. use can be used in a condition

Acceptance criteria

  • Remove findDOMNode warning by removing react-transition-group lib and replacing it by the native Popover API (available in React since v19)
  • Remove defaultProps warning by removing react-beautiful-dnd lib. Vias drag and drop feature isn't used by our current users (To be confirmed with a PO, the lib can be replaced by dndkit if we want to keep the feature)
  • All forwardRef have been replaced by standard ref
  • Context.Provider have been replaced by Context
  • When useful (call ocntext conditionally), replace useContext by use hook
@SharglutDev SharglutDev self-assigned this Jan 13, 2025
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

No branches or pull requests

1 participant