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

Containment as a RefObject #171

Open
ivansky opened this issue Dec 23, 2019 · 2 comments
Open

Containment as a RefObject #171

ivansky opened this issue Dec 23, 2019 · 2 comments

Comments

@ivansky
Copy link

ivansky commented Dec 23, 2019

Hi,

It would be more React-way to use RefObject as approach to get DOM element.

RefObject example

const containmentRef = useRef<HTMLElement>(null); // it will be available after mounting

// it becomes
// { current: null } -> { current: HTMLElement }

<div ref={containmentRef} />
@mrtheyann
Copy link

agreed

@johnbonds
Copy link

This actually works fine for me now...

containment={messageListSectionRef.current}

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

No branches or pull requests

3 participants