Skip to content

feat(useGeolocation): restart a manual watch when position options change - #609

Merged
hyesungoh merged 3 commits into
toss:v1-basefrom
Choi-Jung-Hyeon:feat/geolocation-restart-watch
Nov 19, 2026
Merged

hyesungoh merged 3 commits into
toss:v1-basefrom
Choi-Jung-Hyeon:feat/geolocation-restart-watch

Conversation

@Choi-Jung-Hyeon

Copy link
Copy Markdown
Contributor

Overview

Closes #606

A watch started with startTracking() kept its original options until it was stopped and started again. mountBehavior: 'watch' already restarted with the new options.

Fix

  • While a watch is running, an option change (enableHighAccuracy, maximumAge, timeout) restarts it with the new options, however it was started.
  • A stopped watch is not started again by an option change.
  • The react-hooks/set-state-in-effect disable comment moved to the getCurrentPosition() line, since the lint now reports that line after the condition changed.

Major changeset added. Docs updated (en, ko, ja, zh-Hans, es).

Checklist

  • Did you write the test code?
  • Have you run yarn run fix to format and lint the code and docs?
  • Have you run yarn run test:coverage to make sure there is no uncovered line?
  • Did you write the JSDoc?

🤖 Generated with Claude Code

…ange

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 780ca3e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
react-simplikit Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov-commenter

codecov-commenter commented Nov 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (25e658b) to head (780ca3e).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           v1-base      #609   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           76        76           
  Lines         2447      2447           
  Branches       790       789    -1     
=========================================
  Hits          2447      2447           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

* : timestamp `number` - The time when the position was retrieved;
* - getCurrentPosition `Function` - Function to get the current position once;
* - startTracking `Function` - Function to start tracking location changes;
* - startTracking `Function` - Function to start tracking location changes. While tracking, the watch restarts when `enableHighAccuracy`, `maximumAge` or `timeout` changes;

@hyesungoh hyesungoh Nov 17, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about drop this change?

restarting with new options is what people already expect, so I don't think we need to write it down 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, dropped it.

@hyesungoh hyesungoh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for your contribution! 👍

@hyesungoh
hyesungoh merged commit 30b781d into toss:v1-base Nov 19, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants