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

Maplibre 9.1.0 "Support for string refs will be removed in a future major release. We recommend using useRef() or createRef() instead." #429

Closed
MufeedaFi opened this issue Jul 30, 2024 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@MufeedaFi
Copy link

MufeedaFi commented Jul 30, 2024

I have been using "@maplibre/maplibre-react-native": "9.1.0", in my react native "0.74.2" project. But MapLibreGL is giving some internal error warnings as below, while using these components.

<MapLibreGL.Camera/> as
Warning: Component "Camera" contains the string ref "camera". Support for string refs will be removed in a future major release.

<MapLibreGL.SymbolLayer/> as
Warning: Component "SymbolLayer" contains the string ref "nativeLayer". Support for string refs will be removed in a future major release. We recommend using useRef() or createRef() instead.

<MapLibreGL.LineLayer/> as
Warning: Component "LineLayer" contains the string ref "nativeLayer". Support for string refs will be removed in a future major release. We recommend using useRef() or createRef() instead.

<MapLibreGL.FillLayer/> as
Warning: Component "FillLayer" contains the string ref "nativeLayer". Support for string refs will be removed in a future major release. We recommend using useRef() or createRef() instead.

The issue is fixed with a patch on each of these components as found in
https://stackoverflow.com/questions/63295481/error-function-components-cannot-have-string-refs-we-recommend-using-useref. ie, replacing the internal string refs with createRef().

Please maintain this in the repo, since patching is not a pretty solution. Thanks!

@KiwiKilian
Copy link
Collaborator

This is fixed with the latest v10 pre-releases.

@KiwiKilian KiwiKilian added this to the 10.0.0 milestone Nov 15, 2024
@KiwiKilian KiwiKilian added the enhancement New feature or request label Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants