Skip to content

Trying to lazy load a component that uses custom material ui styles causes issues, here's a solution.

License

Notifications You must be signed in to change notification settings

abivelj/material-ui-typescript-react-lazyload

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

material-ui-typescript-react-lazyload

When lazy loading Material-UI compoents with custom styles if we just extend our interfae like so: export interface NotWorkingProps extends WithStyles<typeof styles> webpack will not build it and you'll get an error.

There is a trick to fix this by creating an inner interface that extends both the exported interface and the With Styles<typeof styles> interface.

Lazy load function is inspired by Lyft's Universal Lazy Load Component

About

Trying to lazy load a component that uses custom material ui styles causes issues, here's a solution.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published