Skip to content

Flow error in chapter 04. Flow error: (This type is incompatible with the expected param type of Element) #249

Open
@durgaprasadksv

Description

@durgaprasadksv

Type of issue: Bug

Chapter: 04

If it's a bug: Yes

Flow error: (This type is incompatible with the expected param type of Element)
ReactDOM.render(, document.querySelector(APP_CONTAINER_SELECTOR));

But if I add the following code.
const rootEl = document.querySelector(APP_CONTAINER_SELECTOR);
if (!(rootEl instanceof Element)) {
throw new Error('invalid type');
}
ReactDOM.render(, rootEl);

the Flow errors are gone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions