react-starter-kit icon indicating copy to clipboard operation
react-starter-kit copied to clipboard

Material-ui RadioButtonGroup doesn't seem to be working with React Starter Kit?

Open vu0tran opened this issue 9 years ago • 11 comments

I posted this issue on StackOverflow as well.

I'm implementing material-ui's RadioButtonGroup component but it seems like there's something in React Starter Kit that's making it incompatible. Any idea what it could be?

When I create a fresh webpack of it here, it works fine, but when I go through RSK's routing, what I get is something that looks like this. The buttons are unresponsive.

I've wrapped material-ui in my client and made sure to inject the tap event plugin.

// client.js

import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import injectTapEventPlugin from 'react-tap-event-plugin';
injectTapEventPlugin();

...
...
    appInstance = ReactDOM.render(
      <App context={context}><MuiThemeProvider>{route.component}</MuiThemeProvider></App>,
      container,
      () => onRenderComplete(route, location),
    );
import React from 'react';
import { RadioButton, RadioButtonGroup } from 'material-ui/RadioButton';

class Contact extends React.Component {

  render() {
    return (
      <div>
        <RadioButtonGroup name="shipSpeed" defaultSelected="not_light">
          <RadioButton
            value="light"
            label="Simple"
          />
          <RadioButton
            value="not_light"
            label="Selected by default"
          />
          <RadioButton
            value="ludicrous"
            label="Custom icon"
          />
        </RadioButtonGroup>
      </div>
    );
  }
}

export default (Contact);

vu0tran avatar Jul 10 '17 07:07 vu0tran

Did you checked browser's console? Any hint there?

langpavel avatar Jul 10 '17 10:07 langpavel

@langpavel Thanks for the reply. The only thing in the console is: "[HMR] connected".

If it would help, I can create a fresh React Starter Kit project with Material-UI and push it to Git.

vu0tran avatar Jul 10 '17 13:07 vu0tran

sorry, I don't know

langpavel avatar Jul 10 '17 19:07 langpavel

Some more information that might help is that this is only happening on latest Chrome browser: Version 60.0.3112.50.

Works as expected on Safari / Firefox.

vu0tran avatar Jul 11 '17 10:07 vu0tran

Then it's really weird. Did you open issue on Material-ui? I'm almost sure that it's not connected to RSK

langpavel avatar Jul 11 '17 10:07 langpavel

@vu0tran I was hit with the same problem, it looks like the problem is with BrowserSync and its option Sync Options on Clicks. After disabling it material-ui works.

Although I'm not sure if the problem is with BrowserSync or material-ui.

kamaz avatar Sep 24 '17 21:09 kamaz

So It's development trouble? It works when you build?

langpavel avatar Sep 24 '17 21:09 langpavel

yes all works when it's built, and it only effects development process

kamaz avatar Sep 25 '17 20:09 kamaz

+1

browserSync({
	port: 3000,
	ui: {
		port: 3001
	},
	ghostMode: false, // <-  

Thx to @kamaz

CostaRico avatar Nov 09 '17 11:11 CostaRico

@CostaRico Thank you! That solved the issue I'm having.

kevinpaulretiban avatar Jun 21 '18 19:06 kevinpaulretiban

@vu0tran thank you very much for crating this issue! Unfortunately, we have close it due to inactivity. Feel free to re-open it or join our Discord channel for discussion.

NOTE: The main branch has been updated with React Starter Kit v2, using JAM-style architecture.

ulani avatar May 27 '21 20:05 ulani