Skip to content

Commit

Permalink
chore: remove typos from code comments (#11852)
Browse files Browse the repository at this point in the history
**Motivation**

"While reviewing the internal implementation, I noticed several typos
stood out. Since these could lead to misunderstandings, especially for
those not fluent in English, I took the opportunity to correct them as
well."

**Test plan**

It's a comment-out modification, so there's no scope of impact.

Co-authored-by: Satyajit Sahoo <satyajit.happy@gmail.com>
  • Loading branch information
ramen2020 and satya164 committed Mar 9, 2024
1 parent e5eacec commit 85f6087
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/useFocusEffect.tsx
Expand Up @@ -71,15 +71,15 @@ export function useFocusEffect(effect: EffectCallback) {
}
};

// We need to run the effect on intial render/dep changes if the screen is focused
// We need to run the effect on initial render/dep changes if the screen is focused
if (navigation.isFocused()) {
cleanup = callback();
isFocused = true;
}

const unsubscribeFocus = navigation.addListener('focus', () => {
// If callback was already called for focus, avoid calling it again
// The focus event may also fire on intial render, so we guard against runing the effect twice
// The focus event may also fire on initial render, so we guard against running the effect twice
if (isFocused) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/useNavigationBuilder.tsx
Expand Up @@ -457,7 +457,7 @@ export function useNavigationBuilder<

let state =
// If the state isn't initialized, or stale, use the state we initialized instead
// The state won't update until there's a change needed in the state we have initalized locally
// The state won't update until there's a change needed in the state we have initialized locally
// So it'll be `undefined` or stale until the first navigation event happens
isStateInitialized(currentState)
? (currentState as State)
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/useRouteCache.tsx
Expand Up @@ -7,7 +7,7 @@ import type { RouteProp } from './types';
type RouteCache = Map<string, RouteProp<ParamListBase>>;

/**
* Utilites such as `getFocusedRouteNameFromRoute` need to access state.
* Utilities such as `getFocusedRouteNameFromRoute` need to access state.
* So we need a way to suppress the warning for those use cases.
* This is fine since they are internal utilities and this is not public API.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/native/src/useScrollToTop.tsx
Expand Up @@ -39,7 +39,7 @@ function getScrollableNode(ref: React.RefObject<ScrollableWrapper>) {
// We need to use `getScrollResponder` to get access to the scroll responder
return ref.current.getScrollResponder();
} else if ('getNode' in ref.current) {
// When a `ScrollView` is wraped in `Animated.createAnimatedComponent`
// When a `ScrollView` is wrapped in `Animated.createAnimatedComponent`
// we need to use `getNode` to get the ref to the actual scrollview.
// Note that `getNode` is deprecated in newer versions of react-native
// this is why we check if we already have a scrollable node above.
Expand Down

0 comments on commit 85f6087

Please sign in to comment.