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

How can you use jQuery's $? #404

Closed
im1dermike opened this issue Dec 18, 2017 · 1 comment
Closed

How can you use jQuery's $? #404

im1dermike opened this issue Dec 18, 2017 · 1 comment

Comments

@im1dermike
Copy link

I'm trying to create a React sandbox with the following code:

declare const $: any;

This works in my own codebase without having to do anything special. I get an "Unexpected token, expected" error, though.

How can I get use jQuery in CodeSandbox and get $ to work?

@CompuIves
Copy link
Member

Heya! You can use jQuery by doing something like this:

import $ from 'jquery';

// Now you can use $

or you can add jQuery (https://code.jquery.com/jquery-3.2.1.min.js) under External Resources under Dependencies in the sidebar.

We have plans to add better support for custom aliases, so that would make it possible to do this in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants