useJquery
useJquery copied to clipboard
[Feature Request] MooTools support
My team doesn't use jQuery, we use MooTools: a collection of JavaScript utilities designed for the intermediate to advanced JavaScript developer. It allows you to write powerful and flexible code with its elegant, well documented, and coherent APIs.
Any chance we can expect support for MooTools? I'd love to see it as an option we can pass to useJquery
, like:
import React, { useEffect } from 'react';
import useJquery from 'react-use-jquery';
export default function App() {
const $$ = useJquery({ mooTools: "yes" });
useEffect(() => {
if ($$) {
$$('.App').html('Hello world');
}
}, [$$]);
return <div className="App" />;
}
This looks perfectly within the scope of this project, I'll happily accept a PR.
Keep in mind potential conflicts with #3 though!
"yes"
is too deterministic for me, what if there's an error?
I think you should take a note from the HTMLMediaElement.canPlayType()
API:
const $$ = useJquery({ mooTools: "probably" });