Skip to content

Commit

Permalink
Fix typos in useIntervalEffect docs, update migration guide (#1261)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeDuncko authored May 24, 2023
1 parent ee22141 commit aeaf3e6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
8 changes: 5 additions & 3 deletions src/__docs__/migrating-from-react-use.story.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Meta} from '@storybook/addon-docs'
import { Meta } from '@storybook/addon-docs';

<Meta title="Migrating from react-use" />

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions src/useIntervalEffect/__docs__/story.mdx
Original file line number Diff line number Diff line change
@@ -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';

<Meta title="Lifecycle/useIntervalEffect" component={Example} />

# useInterval
# useIntervalEffect

Like `setInterval` but in the form of a React hook.

Expand Down
2 changes: 1 addition & 1 deletion src/useIntervalEffect/__tests__/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down
2 changes: 1 addition & 1 deletion src/useIntervalEffect/__tests__/ssr.ts
Original file line number Diff line number Diff line change
@@ -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();
});
Expand Down

0 comments on commit aeaf3e6

Please sign in to comment.