Skip to content

Bug: Canary version unexpectedly removes markup rendered by a component in Strict Mode #28156

Closed
@VasilyStrelyaev

Description

@VasilyStrelyaev

Our 3rd-party component, DevExtreme Reactive Grid, works as expected in React 18.2 (dev mode with Strict Mode enabled). The Canary channel version 18.3.0 however, first renders the component to the DOM and displays it properly (simulating mount-unmount-mount as usual), but then suddenly removes the rendered markup, without any effects being destroyed or lifecycle methods called for class components. The component remains displayed in React Dev Tools. So, I believe there is probably a regression in React Canary 18.3.0.

You will note that the component uses freshly deprecated defaultProps property, hence some messages in the console, but it seems the issue has nothing to do with them.

React version: 18.3.0-canary-971b62f47-20240129

Steps To Reproduce

  1. Run the linked CodeSandbox;
  2. See the empty page displayed because the component is first rendered and then removed. The component and its children are still displayed in React Dev Tools;
  3. Change React version to 18.2.0 in package.json;
  4. See the component properly displayed.

Link to the code example:

https://codesandbox.io/p/sandbox/distracted-visvesvaraya-forked-jlzg8s

The current behavior

The component markup is removed from DOM after the component is rendered.

The expected behavior

The component is displayed on the page.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: UnconfirmedA potential issue that we haven't yet confirmed as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions