Maplibre 9.1.0 "Support for string refs will be removed in a future major release. We recommend using useRef() or createRef() instead." #429
Labels
enhancement
New feature or request
Milestone
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/>
asWarning: Component "Camera" contains the string ref "camera". Support for string refs will be removed in a future major release.
<MapLibreGL.SymbolLayer/>
asWarning: 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/>
asWarning: 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/>
asWarning: 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!
The text was updated successfully, but these errors were encountered: