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

Warning: MarkerView: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead. #430

Closed
Pieeer1 opened this issue Aug 6, 2024 · 2 comments · Fixed by #431
Labels
enhancement New feature or request released on @beta
Milestone

Comments

@Pieeer1
Copy link

Pieeer1 commented Aug 6, 2024

Steps to Trigger Behavior

  1. Create a new MapLibreGL.MapView
    2.. Add a MarkerView with coordinates
  2. Build and run the application. you will receive the warning.

Link to Minimal Reproducible Example

        <View style={styles.container}>
         <MapLibreGL.MapView
            ref={mapRef}
            style={styles.map} 
            logoEnabled={false} 
            styleURL={mapUri + token}
            rotateEnabled={false}
            zoomEnabled={true}
         >
            <MapLibreGL.Camera
            zoomLevel={2}
            centerCoordinate={[defaultView?.longitude ?? 0, defaultView?.latitude ?? 0]}
            />
            { shipment?.shipmentStops.map((x, i) => {
            return (
                <MarkerView key={i} coordinate={[x.location?.longitude ?? 0, x.location?.latitude ?? 0]}>
                    <View style={{backgroundColor: 'red', width: 10, height: 10, borderRadius: 5}}></View>
                </MarkerView>
                )
            })}

            <RippleButton iconName="mode-of-travel" iconSize={25} onPress={() => setIsLiveView(!isLiveView)} color="#000000" ></RippleButton>
         </MapLibreGL.MapView>
        </View>

Expected Behavior

No Warning

Actual Behavior

Warning

Screenshots (if applicable)

image

Version(s) affected

  • Platform: [e.g. Android, iOS]
  • OS version: [e.g. Android 9, iOS 10]
  • Device type: [e.g. iPhone6]
  • Emulator/ Simulator: [yes/ no]
  • Development OS: [e.g. OSX 11.0.1, Win10]
  • maplibre-react-native Version [e.g. 7.0.9]
  • MapLibre GL version [e.g. 6.3.0]
  • React Native Version [e.g. 0.59]

Additional context

@RobertSasak
Copy link
Contributor

Observations

React it deprecating defaultProps in function component. facebook/react#25699
https://github.com/facebook/react/blob/main/CHANGELOG.md#1830-april-25-2024

MarkerView is such a component

const MarkerView = (props: MarkerViewProps): ReactElement => {

@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
Copy link

github-actions bot commented Dec 2, 2024

🎉 This issue has been resolved in version 10.0.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released on @beta
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants