DaveWM/reagent-material-ui

add the react-tap-event-plugin for the Tap error?

narocath opened this issue · 5 comments

As mentioned in material ui here, I had problem with Tabs component. Can you suggest a workaround, (noob in cljs) how I could load it from nodejs/require ... and how to load it before render?

You shouldn't need the tap event plugin any more, it was removed in material ui 0.19.0 (see here). What's the exact problem you're having with the Tabs component?

When I try to pass on Tabs a {:value @tab :on-change #(reset! tab (-> % .-target .-value)} I get "Uncaught TypeError: Cannot read property 'value' of undefined....
at Object.test3_front.core.root_component [as requestChange]....
at Object.Tabs._this.handleTabTouchTap [as onClick]....
at Object.Tab._this.handleTouchTap [as onClick]....
at EnhancedButton._this.handleTouchTap ....
at Object.ReactErrorUtils.invokeGuardedCallback....
at executeDispatch...
at Object.executeDispatchesInOrder...
at executeDispatchesAndRelease.....
at executeDispatchesAndReleaseTopLevel....
at Array.forEach (native)" when I try to click other Tab and print the value of current Tab from props

I think the problem is that the value passed to the :on-change handler is just the value of the tab, not an event. At least that's what it looks like in the material ui docs. Can you try changing your code to: {:value @tab :on-change #(reset! tab %)} and see if that works?

Yup that did the trick!! Thank you m8 stupid from me, it was late I guess :)

haha no worries, glad I could help :)