-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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 to use semantic modules in React components? #4195
Comments
What version of semantic-ui are you using? |
@IonutBajescu I'm using 2.2.. I tried for some time then gave up. For the time being I'm using |
@mihir-harbinger Understood. If you change your mind and want the entire framework, please use the 2.1 version. It appears you're not the only one experiencing problems with webpack and Semantic UI 2.2. |
Version 2.2 works fine for me together with jquery 2.x (jquery 3.0 breaks things though, as mentioned in #4202). |
@IonutBajescu @maksis Thank you for the quick-fix. I'll try it out asap. |
@IonutBajescu Is there any progress on jQuery version issue? I wish to use |
It is impossible to keep jQuery and React's virtual DOM in sync. There's good news, Semantic UI now has an official React project: https://github.com/TechnologyAdvice/stardust It will soon be ported to Semantic-UI-React. Cheers! @KarandikarMihir @maksis @IonutBajescu |
@levithomason Awesome! Why is it not under Semantic-Org? |
We've been busy round the clock working on exactly that. See https://github.com/Semantic-Org/Semantic-UI-React. Track our progress here: Migrating to Semantic-UI-React |
How will the stardust integration affect this issue? Are there plans to allow theming without needing gulp since many react users are using webpack? |
This issue is no longer an issue. The answer is you won't use any SUI modules in React, you'll use Semantic-UI-React components.
Theming concerns only CSS, Semantic-UI-React concerns only JS and generating valid Semantic-UI HTML. So, theming is not within the scope of Semantic-UI-React. Use the current theming system instead. If you search Semantic-UI-React issues, you'll see several issues and ideas that have been raised about this. Maybe someday in the future, we'll design something to ease the need to theme. In a past life, I built an in browser theme designer for Bootstrap called bootstyle (be patient, server goes to sleep). I imagine something similar for SUI except React based and much faster. |
@levithomason Thanks for the response. I was hoping that Semantic-UI would have an official documented way to use Webpack in the near future now that Semantic-UI-React is the official React integration. |
I don't think it is entirely reasonable as Webpack is not technically required, you could use Browserify or some other method of bundling your app. You also just put the latest published <script src="https://unpkg.com/semantic-ui-react/dist/umd/semantic-ui-react.min.js"></script> What I'm poking at is that Semantic-UI-React is a library that is agnostic to your tech stack. As much as I hate maintaining Webpack and build systems, it'd be a bummer to try and manage a guide on how to do that as well. All said, over @TechnologyAdvice (where Semantic-UI-React came from) we've got a tool that handles running a dev server, building, testing, and linting. It is same stack that power's Semantic-UI-React. I hope to use it for Semantic-UI-React soon. We'll likely open source it when that happens. |
Hi, anybody figure out how to get this going? |
@chriswingler It's been days. If I remember correctly, I switched to an older version of |
I have the same problem, when I bundle vendor lib with webpack containing semantic-ui.js and jquery.js, It says that my plugin/component is not a function. I've just started to use webpack, I don't understand what are requirement to use plugin with webpack. |
Closing this as there is now an officially supported and hosted React implementation, https://github.com/Semantic-Org/Semantic-UI-React. @nicolaslawdune Here are some webpack setup examples: Webpack 1: http://react.semantic-ui.com/usage#bundlers |
I'm having trouble integrating semantic modules with React components. I'm using webpack. JQuery is properly loaded, but when I try to use popup() or accordion() functions, it throws error-
App.js?5185:11Uncaught TypeError: (0 , _jquery2.default)(...).popup is not a function
webpack-
React component -
The text was updated successfully, but these errors were encountered: