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

Bug: React-compiler does not handle potentially null objects gracefully when caching function that may not be run due to short-circuit evaluation #31269

Open
bjnsn opened this issue Oct 15, 2024 · 0 comments
Labels
Component: Optimizing Compiler Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug

Comments

@bjnsn
Copy link

bjnsn commented Oct 15, 2024

React version: React 18;
react-compiler-runtime: 0.0.0-experimental-605e95c-20241015
babel-plugin-react-compiler: 0.0.0-experimental-605e95c-20241015

Steps To Reproduce

  1. Use the current react-compiler-runtime / babel-plugin-react-compiler with the small repro shown in this link

React compiler playground link

The current behavior

Errors when trying to access null object

The expected behavior

Should not access null object which would not be accessed without compiler due to short-circuit evaluation.

@bjnsn bjnsn added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Optimizing Compiler Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug
Projects
None yet
Development

No branches or pull requests

2 participants