bad syntax React.useEffect crashs the site

Open
#413 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
react, typescript
Domain
frontend

Research direction

Start by reproducing the pasted snippet in the react-live website at the linked sandbox, then trace how malformed React.useEffect syntax is handled before the “n is not a function” crash. The issue names no source file or test; done means this input no longer breaks the page and the behavior is verified with a regression check.

Written by the indexing model from the issue text.

Description

bug
Is there an existing issue for this?
  • I have searched the existing issues
Code of Conduct
  • I agree to follow this project's Code of Conduct
Code Sandbox link

https://nearform.com/open-source/react-live

Bug report
In react-live website, try pasting this code. Then **n is not a function** error will occur and breaks the page.


() => {
  React.useEffect(()=>[])
}
Image
Dominant language
TypeScript
Stars
4.6k
Forks
260
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from FormidableLabs/react-live

All issues in FormidableLabs/react-live

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.