Month: May 2018
-
Adding a Link to a Drawer – Material UI and ReactJS
Hi everyone, I ran into a bit of an issue turning a menuitem into a link with Material UI and React-Router. The main problems being that underlines appeared and threw the spacing out. To summarize, use the component attribute on the ListItem: The official docs cover it here: https://material-ui.com/api/list-item/ See the following stackoverflow post for…
-
Where to Import Colors from in MaterialUI – ReactJS
Hey everyone, I ran into the following error while trying to import colors in MaterialUI: Module not found: Can’t resolve ‘material-ui/styles/colors’ It turns out that the path to colors changed in V1, so a lot of guides aren’t quite right. All you need to do is change it to the following: /* import {grey, amber}…
-
Full Page Layout Example for Material UI – ReactJS
Hi everyone, I’ve spent the last couple of days looking into MaterialUI. It seems really good however there are very few examples of a layout wireframe. After digging through Github I came across the following CodeSandbox: https://codesandbox.io/embed/vm4r07mxn5 There are a number of other themes and templates available (such as the amazing Material Dashboard) but they…
-
Pass a Component as a Child Prop and Render it – ReactJs
Hi everyone, A quick post on how to pass a component as a prop and then render it as a child. const ChildComponent = () => Child Component; const MainComponent = (props) => Main component. Child appears below{props.content}; class App extends React.Component { render () { return ( <MainComponent content={} /> ); } } An…
-
Remote Desktop: An authentication error has occurred. – This could be due to CredSSP encryption oracle remediation.
Hi everyone, I ran into an auth issue with remote desktop today: An authentication error has occurred. The function requested is not supported. Remote computer: XXXX This could be due to CredSSP encryption oracle remediation. For more information, see hhtps://go.microsoft.com/fwlink/?linkid=866660 The solution is to add the May 2018 Windows Security Update on both the remote…
-
Web API 2 – ExceptionMessage=No MediaTypeFormatter is available to read an object of type ‘HttpPostedFileBase’ from content with media type ‘multipart/form-data’.
Hi everyone, I ran into the following error while trying to get image uploads working with Web API 2: ExceptionMessage=No MediaTypeFormatter is available to read an object of type ‘HttpPostedFileBase’ from content with media type ‘multipart/form-data’. I had been trying to copy the following from an mvc controller in another project: public IHttpActionResult Upload(HttpPostedFileBase file,…
-
DbSet does not contain a definition for ‘FromSQL’ and no extension method ‘FromSql’ accepting an argument of type ‘DbSet’ could be found.
Hi everyone, I ran into the following error while attempting to use a custom query with EntityFramework: DbSet does not contain a definition for ‘FromSQL’ and no extension method ‘FromSql’ accepting an argument of type ‘DbSet’ could be found. This one’s pretty straight forward: // Install the following package via nuget Install-package Microsoft.EntityFrameworkCore.Relational //Add the…
-
Module not found: Can’t resolve ‘babel-polyfill’ in ‘C:Userssourcereposfrontendsrc
Hi everyone, I was looking into asynchronous requests with redux tonight and hit the following error: Module not found: Can’t resolve ‘babel-polyfill’ in ‘C:Userssourcereposfrontendsrc This is used to provide a promise polyfill for a fetch package mentioned in the tutorial. In order to fix it, just run the following: npm install babel-polyfill Thanks to the…
-
Module not found: Can’t resolve ‘redux’ in ‘C:UsersFrontEndSrcfrontendnode_modulesreact-reduxesconnect’
Hi everyone, Another quick one. I’d installed react-redux but was running into the following error: Failed to compile. ./node_modules/react-redux/es/connect/mapDispatchToProps.js Module not found: Can’t resolve ‘redux’ in ‘C:UserssourcereposFrontEndSrcfrontendnode_modulesreact-reduxesconnect’ Fairly easy fix, you need redux as well as react-redux: npm install –save redux Once that’s done, it should all be working! Cheers, Chris
-
index.js:2178 Warning: A component is changing an uncontrolled input of type checkbox to be controlled. Input elements should not switch from uncontrolled to controlled (or vice versa). Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://fb.me/react-controlled-components
Hi everyone, Bit of a silly error I ran into today. This one took an embarrassingly long time to figure out unfortunately: index.js:2178 Warning: A component is changing an uncontrolled input of type checkbox to be controlled. Input elements should not switch from uncontrolled to controlled (or vice versa). Decide between using a controlled or…