Skip to content

Duplicate rerendering when using ReactWithInit #890

@ntucakovic

Description

@ntucakovic

I think that the Environment.CreateComponent does a side effect of adding a component to _components list, and is overlooked when using ReactWithInit.

var reactComponent = Environment.CreateComponent(componentName, props, containerId, clientOnly);

At least we should be able to remove the rendered component from list of _components once it's successfully added to the markup.

I realized this was going on because I couldn't use get ReactWithInit to work without throwing me the ReactDOM is undefined error in console. Realized that it's working because it sort of fallbacks to default behavior and just adds the component to the render/hydrate list at the bottom of the page, after all react dependencies are loaded.

I'm using v4.1.0 on the project but I think this is applicable to v5.0 as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions