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

Document that ReactTapEventPlugin(js.undefined) is needed in JSApp body #86

Open
beikern opened this issue Jul 18, 2017 · 1 comment
Open

Comments

@beikern
Copy link

beikern commented Jul 18, 2017

If ReactTapEventPlugin(js.undefined) is not provided in the JsApp body the browser's console throws the following warning:

warning.js:36 Warning: Unknown prop `onTouchTap` on <button> tag. Remove this prop from the element. For details, see https://fb.me/react-unknown-prop
    in button (created by EnhancedButton)
    in EnhancedButton (created by FlatButton)
    in FlatButton (created by NavToolBar)
    in div (created by ToolbarGroup)
    in ToolbarGroup (created by NavToolBar)
    in div (created by Toolbar)
    in Toolbar (created by NavToolBar)
    in NavToolBar (created by Router)
    in MuiThemeProvider (created by Router)
    in div (created by Router)
    in nav (created by Router)
    in div (created by Router)
    in Router

Just putting it in the JsApp solves the warning, just like this:

object MyApp extends JSApp {
  //TODO: dev-server complains that we load several times?
  ReactTapEventPlugin(js.undefined)

  @JSExport
  override def main(): Unit = {
    val baseTheme = Mui.Styles.LightRawTheme
    val theme: MuiTheme =
      Mui.Styles.getMuiTheme(baseTheme)

    AppCSS.load()
    val router = MuiMuiThemeProvider(muiTheme = theme)(AppRouter.router())
    router.renderIntoDOM(dom.document.getElementById("content"))

    ()
  }
}
@beikern
Copy link
Author

beikern commented Jul 18, 2017

If the plugin is not present some Mui functionality does not work, like rendering MuiIconMenu with menuItems childrens when the icon is clicked. Even if the browser says it's a warning MUI will malfunction if the plugin is not in scope.

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

1 participant