Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #6

Merged
merged 1 commit into from
May 30, 2024
Merged

Conversation

sandercox
Copy link
Contributor

WHen using TypeScript I couldn't get my containerRef to work as it was not of the expected format RefObject<HTMLElement>. I

RefObject expected either HTMLElement or null:

    interface RefObject<T> {
        /**
         * The current value of the ref.
         */
        readonly current: T | null;
    }

Calling useRef without initial arguments creates the ref as MutableRefObject<T | undefined> which is incompatible.

WHen using TypeScript I couldn't get my containerRef to work as it was not of the expected format `RefObject<HTMLElement>`. I 

RefObject expected either HTMLElement or null:
```ts
    interface RefObject<T> {
        /**
         * The current value of the ref.
         */
        readonly current: T | null;
    }
```

Calling useRef without initial arguments creates the ref as `MutableRefObject<T | undefined>` which is incompatible.
Copy link
Owner

@katspaugh katspaugh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@katspaugh katspaugh merged commit fa836d7 into katspaugh:main May 30, 2024
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants