hupe1980 / gatsby-theme-material-ui

Gatsby theme for Material-UI
MIT License
100 stars 42 forks source link

Ref Type Error #45

Closed ohlr closed 4 years ago

ohlr commented 4 years ago

Declaring a ref like this const anchorRef = React.useRef<HTMLButtonElement>(null); I get this error:

Bildschirmfoto von 2020-07-25 21-09-15

Type 'RefObject<HTMLButtonElement>' is not assignable to type '((instance: Ref<unknown>) => void) | RefObject<Ref<unknown>> | null | undefined'.
  Type 'RefObject<HTMLButtonElement>' is not assignable to type 'RefObject<Ref<unknown>>'.
    Type 'HTMLButtonElement' is not assignable to type 'Ref<unknown>'.
      Property 'current' is missing in type 'HTMLButtonElement' but required in type 'RefObject<unknown>'.