Closed FreddyAyala closed 6 years ago
@FreddyAyala I have forked this repository and migrated it to react-admin. I've also added a ColorField which I was already using locally.
https://www.npmjs.com/package/react-admin-color-input
@dreinke if you want to incorporate these changes here please reply and I'll gladly delete my own module.
Thanks, @vascofg. I'll mention your repo in the readme.
Test with the latest version with react-admin": "^2.0.2" (new version of admin on rest) and it doesn't work, we have the following error:
index.js:2178 Warning: Failed context type: The context
muiTheme
is marked as required inTextField
, but its value isundefined
. in TextField (created by ColorInput) in div (created by ColorInput) in ColorInput (at WelcomePage.js:96) in div (created by FormInput) in FormInput (created by WithStyles(FormInput)) in WithStyles(FormInput) (created by SimpleForm) in div (created by SimpleForm) in form (created by SimpleForm) in SimpleForm (created by WithStyles(SimpleForm)) in WithStyles(SimpleForm) (created by Form(WithStyles(SimpleForm))) in Form(WithStyles(SimpleForm)) (created by Connect(Form(WithStyles(SimpleForm)))) in Connect(Form(WithStyles(SimpleForm))) (created by ReduxForm) in ReduxForm (created by TranslatedComponent(undefined)) in TranslatedComponent(undefined) (created by Connect(TranslatedComponent(undefined))) in Connect(TranslatedComponent(undefined)) (at WelcomePage.js:79) in div (created by Paper) in Paper (created by WithStyles(Paper)) in WithStyles(Paper) (created by Card) in Card (created by WithStyles(Card)) in WithStyles(Card) (created by EditView) in div (created by EditView) in EditView (created by EditController) in EditController (created by TranslatedComponent(undefined)) in TranslatedComponent(undefined) (created by Connect(TranslatedComponent(undefined))) in Connect(TranslatedComponent(undefined)) (created by Edit) in Edit (at WelcomePage.js:78) in WelcomePageEdit (created by WithPermissions) in WithPermissions (created by Connect(WithPermissions)) in Connect(WithPermissions) (created by getContext(Connect(WithPermissions))) in getContext(Connect(WithPermissions)) (created by Route) in Route (created by Resource) in Switch (created by Resource) in Resource (created by Connect(Resource)) in Connect(Resource) (at App.js:29) in Route (created by RoutesWithLayout) in Switch (created by RoutesWithLayout) in RoutesWithLayout (created by Route) in div (created by Layout) in main (created by Layout) in div (created by Layout) in div (created by Layout) in Layout (created by WithStyles(Layout)) in WithStyles(Layout) (created by Connect(WithStyles(Layout))) in Connect(WithStyles(Layout)) (created by LayoutWithTheme) in MuiThemeProvider (created by LayoutWithTheme) in LayoutWithTheme (created by Route) in Route (created by CoreAdminRouter) in Switch (created by CoreAdminRouter) in div (created by CoreAdminRouter) in CoreAdminRouter (created by Connect(CoreAdminRouter)) in Connect(CoreAdminRouter) (created by getContext(Connect(CoreAdminRouter))) in getContext(Connect(CoreAdminRouter)) (created by Route) in Route (created by CoreAdmin) in Switch (created by CoreAdmin) in Router (created by ConnectedRouter) in ConnectedRouter (created by CoreAdmin) in TranslationProvider (created by withContext(TranslationProvider)) in withContext(TranslationProvider) (created by Connect(withContext(TranslationProvider))) in Connect(withContext(TranslationProvider)) (created by CoreAdmin) in Provider (created by CoreAdmin) in CoreAdmin (created by withContext(CoreAdmin)) in withContext(CoreAdmin) (at App.js:23) in App (at index.js:7) stack_frame_overlay_proxy_console @ index.js:2178 printWarning @ warning.js:33 warning @ warning.js:57 checkPropTypes @ checkPropTypes.js:52 getMaskedContext @ react-dom.development.js:10845 constructClassInstance @ react-dom.development.js:6782 updateClassComponent @ react-dom.development.js:8324 beginWork @ react-dom.development.js:8966 performUnitOfWork @ react-dom.development.js:11798 workLoop @ react-dom.development.js:11827 renderRoot @ react-dom.development.js:11858 performWorkOnRoot @ react-dom.development.js:12422 performWork @ react-dom.development.js:12343 performSyncWork @ react-dom.development.js:12320 requestWork @ react-dom.development.js:12220 scheduleWorkImpl @ react-dom.development.js:12095 scheduleWork @ react-dom.development.js:12055 enqueueSetState @ react-dom.development.js:6632 ./node_modules/react/cjs/react.development.js.Component.setState @ react.development.js:242 onStateChange @ connectAdvanced.js:205 notify @ Subscription.js:26 notifyNestedSubs @ Subscription.js:65 onStateChange @ connectAdvanced.js:202 notify @ Subscription.js:26 notifyNestedSubs @ Subscription.js:65 onStateChange @ connectAdvanced.js:202 notify @ Subscription.js:26 notifyNestedSubs @ Subscription.js:65 onStateChange @ connectAdvanced.js:202 notify @ Subscription.js:26 notifyNestedSubs @ Subscription.js:65 onStateChange @ connectAdvanced.js:202 dispatch @ createStore.js:173 (anonymous) @ middleware.js:13 (anonymous) @ middleware.js:66 dispatch @ applyMiddleware.js:35 (anonymous) @ utils.js:250 (anonymous) @ proc.js:489 exec @ scheduler.js:19 flush @ scheduler.js:60 asap @ scheduler.js:33 runPutEffect @ proc.js:486 runEffect @ proc.js:435 next @ proc.js:315 currCb @ proc.js:388 Promise.then (async) resolvePromise @ proc.js:450 runCallEffect @ proc.js:517 runEffect @ proc.js:435 next @ proc.js:315 currCb @ proc.js:388 checkEffectEnd @ proc.js:612 chCbAtKey @ proc.js:627 currCb @ proc.js:388 (anonymous) @ proc.js:499 exec @ scheduler.js:19 flush @ scheduler.js:60 asap @ scheduler.js:33 (anonymous) @ channel.js:185 emit @ channel.js:26 (anonymous) @ middleware.js:67 (anonymous) @ bindActionCreators.js:3 updateData @ EditController.js:152 componentDidMount @ EditController.js:124 commitLifeCycles @ react-dom.development.js:9768 commitAllLifeCycles @ react-dom.development.js:11439 callCallback @ react-dom.development.js:104 invokeGuardedCallbackDev @ react-dom.development.js:142 invokeGuardedCallback @ react-dom.development.js:191 commitRoot @ react-dom.development.js:11578 completeRoot @ react-dom.development.js:12475 performWorkOnRoot @ react-dom.development.js:12425 performWork @ react-dom.development.js:12343 performSyncWork @ react-dom.development.js:12320 requestWork @ react-dom.development.js:12220 scheduleWorkImpl @ react-dom.development.js:12095 scheduleWork @ react-dom.development.js:12055 scheduleRootUpdate @ react-dom.development.js:12683 updateContainerAtExpirationTime @ react-dom.development.js:12711 updateContainer @ react-dom.development.js:12730 ./node_modules/react-dom/cjs/react-dom.development.js.ReactRoot.render @ react-dom.development.js:16030 (anonymous) @ react-dom.development.js:16449 unbatchedUpdates @ react-dom.development.js:12530 legacyRenderSubtreeIntoContainer @ react-dom.development.js:16445 render @ react-dom.development.js:16513 ./src/index.js @ index.js:7 webpack_require @ bootstrap 1da87517ca036f2b9da0:678 fn @ bootstrap 1da87517ca036f2b9da0:88 0 @ uploadFeature.js:102 webpack_require @ bootstrap 1da87517ca036f2b9da0:678 (anonymous) @ bootstrap 1da87517ca036f2b9da0:724 (anonymous) @ bootstrap 1da87517ca036f2b9da0:724 2TextField.js:354 Uncaught TypeError: Cannot read property 'prepareStyles' of undefined at TextField.render (TextField.js:354) at finishClassComponent (react-dom.development.js:8377) at updateClassComponent (react-dom.development.js:8345) at beginWork (react-dom.development.js:8966) at performUnitOfWork (react-dom.development.js:11798) at workLoop (react-dom.development.js:11827) at HTMLUnknownElement.callCallback (react-dom.development.js:104) at Object.invokeGuardedCallbackDev (react-dom.development.js:142) at invokeGuardedCallback (react-dom.development.js:191) at replayUnitOfWork (react-dom.development.js:11302) at renderRoot (react-dom.development.js:11869) at performWorkOnRoot (react-dom.development.js:12422) at performWork (react-dom.development.js:12343) at performSyncWork (react-dom.development.js:12320) at requestWork (react-dom.development.js:12220) at scheduleWorkImpl (react-dom.development.js:12095) at scheduleWork (react-dom.development.js:12055) at Object.enqueueSetState (react-dom.development.js:6632) at Connect../node_modules/react/cjs/react.development.js.Component.setState (react.development.js:242) at Connect.onStateChange (connectAdvanced.js:205) at Object.notify (Subscription.js:26) at Subscription.notifyNestedSubs (Subscription.js:65) at Connect.onStateChange (connectAdvanced.js:202) at Object.notify (Subscription.js:26) at Subscription.notifyNestedSubs (Subscription.js:65) at Connect.onStateChange (connectAdvanced.js:202) at Object.notify (Subscription.js:26) at Subscription.notifyNestedSubs (Subscription.js:65) at Connect.onStateChange (connectAdvanced.js:202) at Object.notify (Subscription.js:26) at Subscription.notifyNestedSubs (Subscription.js:65) at Connect.onStateChange (connectAdvanced.js:202) at dispatch (createStore.js:173) at middleware.js:13 at middleware.js:66 at dispatch (applyMiddleware.js:35) at utils.js:250 at proc.js:489 at exec (scheduler.js:19) at flush (scheduler.js:60) at asap (scheduler.js:33) at runPutEffect (proc.js:486) at runEffect (proc.js:435) at next (proc.js:315) at currCb (proc.js:388) at