From aeaf3e673ce22db74ff2f87eacf5194973b83fba Mon Sep 17 00:00:00 2001 From: Joe Duncko Date: Wed, 24 May 2023 09:26:53 -0400 Subject: [PATCH] Fix typos in useIntervalEffect docs, update migration guide (#1261) --- src/__docs__/migrating-from-react-use.story.mdx | 8 +++++--- src/useIntervalEffect/__docs__/story.mdx | 8 ++++---- src/useIntervalEffect/__tests__/dom.ts | 2 +- src/useIntervalEffect/__tests__/ssr.ts | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/__docs__/migrating-from-react-use.story.mdx b/src/__docs__/migrating-from-react-use.story.mdx index 79d50600..3c3c2bec 100644 --- a/src/__docs__/migrating-from-react-use.story.mdx +++ b/src/__docs__/migrating-from-react-use.story.mdx @@ -1,4 +1,4 @@ -import {Meta} from '@storybook/addon-docs' +import { Meta } from '@storybook/addon-docs'; @@ -238,7 +238,9 @@ Not implemented yet #### useInterval -Not implemented yet +Implemented as [useIntervalEffect](/docs/lifecycle-useintervaleffect--example) + +No API changes, besides name change. #### useSpring @@ -498,7 +500,7 @@ No API changes. #### useEffectOnce -No plans to implement +Was just an alias for [useMountEffect](/docs/lifecycle-usemounteffect-example) - use that directly instead. #### useEvent diff --git a/src/useIntervalEffect/__docs__/story.mdx b/src/useIntervalEffect/__docs__/story.mdx index dafa0f53..7a913384 100644 --- a/src/useIntervalEffect/__docs__/story.mdx +++ b/src/useIntervalEffect/__docs__/story.mdx @@ -1,10 +1,10 @@ -import {Canvas, Meta, Story} from '@storybook/addon-docs'; -import {Example} from './example.stories'; -import {ImportPath} from '../../__docs__/ImportPath'; +import { Canvas, Meta, Story } from '@storybook/addon-docs'; +import { Example } from './example.stories'; +import { ImportPath } from '../../__docs__/ImportPath'; -# useInterval +# useIntervalEffect Like `setInterval` but in the form of a React hook. diff --git a/src/useIntervalEffect/__tests__/dom.ts b/src/useIntervalEffect/__tests__/dom.ts index 1547ca16..51d2cca1 100644 --- a/src/useIntervalEffect/__tests__/dom.ts +++ b/src/useIntervalEffect/__tests__/dom.ts @@ -2,7 +2,7 @@ import { renderHook } from '@testing-library/react-hooks/dom'; import { useIntervalEffect } from '../..'; import advanceTimersByTime = jest.advanceTimersByTime; -describe('useInterval', () => { +describe('useIntervalEffect', () => { beforeAll(() => { jest.useFakeTimers(); }); diff --git a/src/useIntervalEffect/__tests__/ssr.ts b/src/useIntervalEffect/__tests__/ssr.ts index e1bf3059..cc9c6093 100644 --- a/src/useIntervalEffect/__tests__/ssr.ts +++ b/src/useIntervalEffect/__tests__/ssr.ts @@ -1,7 +1,7 @@ import { renderHook } from '@testing-library/react-hooks/server'; import { useIntervalEffect } from '../..'; -describe('useInterval', () => { +describe('useIntervalEffect', () => { it('should be defined', () => { expect(useIntervalEffect).toBeDefined(); });