From 9c84b595121fa389ba17a35ad082a00299176949 Mon Sep 17 00:00:00 2001 From: Kilian Finger Date: Thu, 21 Nov 2024 07:11:38 +0100 Subject: [PATCH 001/104] chore: migrate BugReport example --- .github/ISSUE_TEMPLATE/bug_report.md | 3 +- .../{BugReportPage.js => BugReport.tsx} | 67 +++++++++---------- packages/examples/src/examples/index.ts | 2 +- packages/examples/src/scenes/Examples.tsx | 2 +- 4 files changed, 34 insertions(+), 40 deletions(-) rename packages/examples/src/examples/{BugReportPage.js => BugReport.tsx} (52%) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 5ed8b1067..ada5deb8f 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -15,7 +15,7 @@ Hello! Thanks for contributing. For the fastest response and resolution, please - For build issues: Can you reproduce it on a clean install of the example app? Please include full steps to reproduce from `react-native init` - - Include a link to a minimal demonstration of the bug, ideally a single component with one MapView. Use an example like [PointInMapView](/packages/examples/src/BugReportPage.js) as a starting point. + - Include a link to a minimal demonstration of the bug, ideally a single component with one MapView. Use an example like [PointInMapView](/packages/examples/src/BugReport.tsx) as a starting point. - Ensure you can reproduce the bug using the latest release. @@ -48,5 +48,6 @@ Hello! Thanks for contributing. For the fastest response and resolution, please - MapLibre Native Version: [e.g. 6.7.0] - `react-native` Version: [e.g. 0.75.0] - `expo` Version: [e.g. 51.0.0] +- Architecture: [new/old] ### Additional context diff --git a/packages/examples/src/examples/BugReportPage.js b/packages/examples/src/examples/BugReport.tsx similarity index 52% rename from packages/examples/src/examples/BugReportPage.js rename to packages/examples/src/examples/BugReport.tsx index 3e6eeeb12..cd9f20206 100644 --- a/packages/examples/src/examples/BugReportPage.js +++ b/packages/examples/src/examples/BugReport.tsx @@ -5,7 +5,7 @@ import { CircleLayer, Camera, } from "@maplibre/maplibre-react-native"; -import React from "react"; +import React, { useState } from "react"; import { Button } from "react-native"; import Page from "./common/Page"; @@ -18,7 +18,7 @@ const styles = { }, }; -const features = { +const FEATURE_COLLECTION: GeoJSON.FeatureCollection = { type: "FeatureCollection", features: [ { @@ -58,40 +58,33 @@ const features = { ], }; -class BugReportPage extends React.Component { - state = { - radius: 20, - }; +export default function BugReport() { + const [radius, setRadius] = useState(20); - render() { - const circleLayerStyle = { - ...styles.circleLayer, - ...{ circleRadius: this.state.radius }, - }; - - return ( - -