Skip to content

Conversation

rickhanlonii
Copy link
Member

Adds a test that shows using anywhere outside of the root node will not fire strict effects.

This works:

root.render(
  <StrictMode>
    <App>
      <Children />
    </App>
  </StrictMode>
);

This does not fire strict effects on mount:

root.render(
  <App>
    <StrictMode>
      <Children />
    </StrictMode>
  </App>
);

Copy link

vercel bot commented Dec 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-compiler-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 17, 2024 9:14pm

@react-sizebot
Copy link

Comparing: 34ee391...bbc0f14

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 6.68 kB 6.68 kB = 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 510.66 kB 510.66 kB = 91.30 kB 91.30 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB +0.05% 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 515.44 kB 515.44 kB = 92.15 kB 92.15 kB
facebook-www/ReactDOM-prod.classic.js = 592.36 kB 592.36 kB = 104.36 kB 104.36 kB
facebook-www/ReactDOM-prod.modern.js = 582.63 kB 582.63 kB = 102.81 kB 102.81 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 3338ac8

@rickhanlonii rickhanlonii merged commit e1d843f into facebook:main Dec 18, 2024
187 checks passed
@rickhanlonii rickhanlonii deleted the rh/strict-mode-test branch December 18, 2024 18:29
github-actions bot pushed a commit that referenced this pull request Dec 18, 2024
Adds a test that shows using <StrictMode /> anywhere outside of the root
node will not fire strict effects.

This works:

```js
root.render(
  <StrictMode>
    <App>
      <Children />
    </App>
  </StrictMode>
);
  ```

  This does not fire strict effects on mount:
```js
root.render(
  <App>
    <StrictMode>
      <Children />
    </StrictMode>
  </App>
);
```

DiffTrain build for [e1d843f](e1d843f)
github-actions bot pushed a commit that referenced this pull request Dec 18, 2024
Adds a test that shows using <StrictMode /> anywhere outside of the root
node will not fire strict effects.

This works:

```js
root.render(
  <StrictMode>
    <App>
      <Children />
    </App>
  </StrictMode>
);
  ```

  This does not fire strict effects on mount:
```js
root.render(
  <App>
    <StrictMode>
      <Children />
    </StrictMode>
  </App>
);
```

DiffTrain build for [e1d843f](e1d843f)
github-actions bot pushed a commit to code/lib-react that referenced this pull request Dec 18, 2024
Adds a test that shows using <StrictMode /> anywhere outside of the root
node will not fire strict effects.

This works:

```js
root.render(
  <StrictMode>
    <App>
      <Children />
    </App>
  </StrictMode>
);
  ```

  This does not fire strict effects on mount:
```js
root.render(
  <App>
    <StrictMode>
      <Children />
    </StrictMode>
  </App>
);
```

DiffTrain build for [e1d843f](facebook@e1d843f)
github-actions bot pushed a commit to code/lib-react that referenced this pull request Dec 18, 2024
Adds a test that shows using <StrictMode /> anywhere outside of the root
node will not fire strict effects.

This works:

```js
root.render(
  <StrictMode>
    <App>
      <Children />
    </App>
  </StrictMode>
);
  ```

  This does not fire strict effects on mount:
```js
root.render(
  <App>
    <StrictMode>
      <Children />
    </StrictMode>
  </App>
);
```

DiffTrain build for [e1d843f](facebook@e1d843f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants