diff --git a/.travis.yml b/.travis.yml index e5d651f..c613b05 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,3 +15,4 @@ script: - yarn lint - yarn test:ci - yarn build + - yarn build:demo diff --git a/src/Section.tsx b/src/Section.tsx index ae22936..f772d30 100644 --- a/src/Section.tsx +++ b/src/Section.tsx @@ -3,13 +3,13 @@ import { ScrollContext } from './context'; type Props = { id: string; - meta: unknown; + meta?: unknown; children: React.ReactNode; } & React.HTMLProps; 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 (
diff --git a/src/types.d.ts b/src/types.d.ts index 911dfed..44f3844 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -7,7 +7,7 @@ type Meta = { }; type ScrollContextType = { - registerRef: ({id: string, meta: unknown}) => RefObject | null; + registerRef: ({ id: string, meta: unknown }) => RefObject | null; scrollTo: (section: string) => void; refs: RefsRegister; meta: Meta;