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

Typescript not working #404

Closed
2 tasks done
FleetAdmiralJakob opened this issue Dec 7, 2024 · 1 comment
Closed
2 tasks done

Typescript not working #404

FleetAdmiralJakob opened this issue Dec 7, 2024 · 1 comment
Labels

Comments

@FleetAdmiralJakob
Copy link

FleetAdmiralJakob commented Dec 7, 2024

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

No response

Bug report

Code like that where we are using Typescript is not working:

declare const jQuery: any;
function Demo() {
  const [, status] = useScriptTag(
    "https://code.jquery.com/jquery-3.5.1.min.js",
  );

  const [version, setVersion] = useState(0);
  useEffect(() => {
    if (typeof jQuery !== "undefined") {
      setVersion(jQuery.fn.jquery);
    }
  }, [status]);

  return <div>jQuery version: {version}</div>;
}

Error:

SyntaxError: Unexpected token, expected "," (3:9)
@FleetAdmiralJakob FleetAdmiralJakob changed the title skipping elements in array destructuring not working Typescript not working Dec 7, 2024
@carbonrobot
Copy link
Contributor

The above code is not working because you are not rendering anything. See the other issue you filed for more information.

@carbonrobot carbonrobot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants