mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-27 05:28:43 +02:00
refactor(theme-common): rename useDynamicCallback to useEvent (#7671)
This commit is contained in:
parent
9473508c33
commit
2c7012f706
7 changed files with 15 additions and 15 deletions
|
@ -16,7 +16,7 @@ import React, {
|
|||
} from 'react';
|
||||
import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment';
|
||||
import useIsBrowser from '@docusaurus/useIsBrowser';
|
||||
import {useDynamicCallback, ReactContextError} from './reactUtils';
|
||||
import {useEvent, ReactContextError} from './reactUtils';
|
||||
|
||||
type ScrollController = {
|
||||
/** A boolean ref tracking whether scroll events are enabled. */
|
||||
|
@ -104,7 +104,7 @@ export function useScrollPosition(
|
|||
const {scrollEventsEnabledRef} = useScrollController();
|
||||
const lastPositionRef = useRef<ScrollPosition | null>(getScrollPosition());
|
||||
|
||||
const dynamicEffect = useDynamicCallback(effect);
|
||||
const dynamicEffect = useEvent(effect);
|
||||
|
||||
useEffect(() => {
|
||||
const handleScroll = () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue