Skip to content

Commit

Permalink
fix: types in build demo
Browse files Browse the repository at this point in the history
  • Loading branch information
EmaSuriano committed Oct 23, 2020
1 parent 556c29c commit 4b1115f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ script:
- yarn lint
- yarn test:ci
- yarn build
- yarn build:demo
4 changes: 2 additions & 2 deletions src/Section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { ScrollContext } from './context';

type Props = {
id: string;
meta: unknown;
meta?: unknown;
children: React.ReactNode;
} & React.HTMLProps<HTMLButtonElement>;

const Section = ({ id, children, meta, ...rest }: Props) => {
const { registerRef } = useContext(ScrollContext);
const ref = useMemo(() => registerRef({id, meta}), [id]);
const ref = useMemo(() => registerRef({ id, meta }), [id]);

return (
<section {...rest} ref={ref} id={id}>
Expand Down
2 changes: 1 addition & 1 deletion src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type Meta = {
};

type ScrollContextType = {
registerRef: ({id: string, meta: unknown}) => RefObject<HTMLElement> | null;
registerRef: ({ id: string, meta: unknown }) => RefObject<HTMLElement> | null;
scrollTo: (section: string) => void;
refs: RefsRegister;
meta: Meta;
Expand Down

0 comments on commit 4b1115f

Please sign in to comment.