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

React / Vanilla JS question #16

Closed
AlexBHarley opened this issue Jan 12, 2021 · 9 comments
Closed

React / Vanilla JS question #16

AlexBHarley opened this issue Jan 12, 2021 · 9 comments

Comments

@AlexBHarley
Copy link

Love this gantt chart, it's awesome, thanks for all your work and under the MIT license.

My issue is I need it in React. I see a few options:

  • fork it, rip out svelte stuff and replace with JSX
  • collaborate with you making it React compatible
  • collaborate with you making it vanilla JS, that way anyone (React / Vue / Svelte) can import it.

Curious to hear your thoughts on this.

@ANovokmet
Copy link
Owner

The built module is already library agnostic - It's made with Svelte but the dist files have no other dependencies except moment.js (and I hope that will change too, see https://github.com/ANovokmet/svelte-gantt/blob/gh-pages/dist/lib.js), and that is one of the reasons why I decided to use Svelte.

I could however help you import it in a React project, and fix any issues preventing it from being used with React. Another good option is writing a wrapper library for React.

@AlexBHarley
Copy link
Author

Gotcha, thanks for getting back to me. Makes sense that the bundle is agnostic actually. I'll take some time to see how it plays with React and let you know!

@fabiiomiiguel
Copy link

The package works great with Vue.js

@ANovokmet
Copy link
Owner

And it works well with Angular, too :)

@AlexBHarley
Copy link
Author

Slowly starting to get the React adapter together, would you want it part of this repository or my own?

@ANovokmet
Copy link
Owner

Slowly starting to get the React adapter together, would you want it part of this repository or my own?

I think it's better for that to be another repository.

@ANovokmet
Copy link
Owner

ANovokmet commented Jan 29, 2021

@darekeapp I've sent you an example piece of code on how to load svelte-gantt in a react component I've made in codesandbox.io. The missing thing is svelte-gantt.css which is obviously missing from the snippet. Please refer to the svelte-gantt installation instructions. I am not a react developer and I'm not aware of the best practices on loading CSS into react apps, but usually you use a <link> tag in the <head> element.

@ngohoang1254
Copy link

@darekeapp I've sent you an example piece of code on how to load svelte-gantt in a react component I've made in codesandbox.io. The missing thing is svelte-gantt.css which is obviously missing from the snippet. Please refer to the svelte-gantt installation instructions. I am not a react developer and I'm not aware of the best practices on loading CSS into react apps, but usually you use a <link> tag in the <head> element.

Can you send me that codesanbox.io. I have problem build this chart in React.

@V-Py V-Py closed this as completed May 1, 2022
@willnaoosmith
Copy link

Tried using it on ReactJS, kept getting Module not found: Error: Can't resolve 'svelte-gantt' even after installing it and importing as said on README.md

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

6 participants