-
Notifications
You must be signed in to change notification settings - Fork 50.5k
Open
Labels
Status: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bug
Description
I tried using the new <geolocation> element in Chrome, but React didn't recognize the props.
This element is only available in Chrome so far, and only in Chrome 144+. Not sure what the policy is for adding new elements to React, but thought I'd log this.
React version: 19.2.3
Steps To Reproduce
- Use Chrome 144 or higher
- Try to view a React component with the
<geolocation>html element, like this:
function Location() {
const handleLocation = (e) => {
console.log(e);
};
return (
<geolocation
onLocation={handleLocation}
autoLocate={false}
accuracyMode="precise"
></geolocation>
);
}Link to code example:
https://stackblitz.com/edit/react-geolocation-repro?file=src%2FApp.jsx
The current behavior
The component renders, but with console errors:
Unknown event handler property `onLocation`. It will be ignored.
React does not recognize the `autoLocate` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `autolocate` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
React does not recognize the `accuracyMode` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `accuracymode` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
The expected behavior
React recognizes the props for <geolocation/> as documented in https://developer.chrome.com/blog/geolocation-html-element#implementation
Metadata
Metadata
Assignees
Labels
Status: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bug