Repository navigation
Replies: 2 comments 1 reply
|
Integrating things with Solid is always the same in Solid whether you want to integrate with classes or anything else. You can't use them directly. Unless you have a more specific question it's hard to describe the whole process of integrating a vanilla JS library with Solid, but in order to get a general idea maybe you can look at how other people have already integrated vanilla libraries. |
0 replies
|
Typically you wrap these things in component wrappers. If you can pass the element in, instead of a selector is better. But generally you'd do something like: function DatePicker() {
onMount(() => {
const datePicker = MCDatepicker.create({
el: '#datepicker',
bodyType: 'modal'
});
onCleanup(() => datePicker.dispose());
});
return <div id="datepicker" />
}This is just a rough example. As I said getting a ref to the element would be better. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi Fellow SolidJs friends,
I am new to SolidJs and would like to use vanilla JS components in a SolidJs project.
For example this calendar:
https://mcdatepicker.netlify.app/usage
/* javascript */
const datePicker = MCDatepicker.create({
el: '#datepicker',
bodyType: 'modal'
});
All reactions