How to integrate Material-UI CSS Framework into create-react-app (CRA) TypeScript

Publicado el: 25 noviembre 2020
en el canal de: React Tutorials & Tips For ReactJs, d3 Developers
28
1

Material-UI CSS Framework

A CSS framework (or CSS library) is based on the concept of bringing a more standardized practice to your web development. Using a CSS Framework you can speed up your web development effort vs using CSS (or other style sheets) as it allows us to use predefined web elements.

Yes, we could create our custom components and style them from scratch, but most times it isn't worth the effort, and besides writing the components we would need to test them on all browsers and all devices sizes, can you imagine?

Both Bootstrap and Material are good CSS frameworks in certain projects to get started right away, without spending hours creating your own common components.

To install I will be setting up Material-UI core as well as the application's icons bundle;
$ yarn add -D @material-ui/core @material-ui/icons

To get Material-UI work seamlessly with TS we also need to update some settings in our ‘tsconfig.json’ file, following the recommendation of setting up TS page on React to avoid errors;

Open tsconfig.json with text editor and update;
{
"compilerOptions": {
"target": "es5",
"lib": [
"es6", "dom",
"dom",
"dom.iterable",
"esnext"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react"
},
"include": [
"src"
]
}

Take the Digital Course & Get 40 Pages React Book
https://www.udemy.com/course/getting-...

Get Free React 17 Book Chapter
https://elielrom.com/ReactBook

View the article on Medium
  / setting-up-professional-react-project-with...  

Learning React?
https://github.com/EliEladElrom/react...


En esta página del sitio puede ver el video en línea How to integrate Material-UI CSS Framework into create-react-app (CRA) TypeScript de Duración hora minuto segunda en buena calidad , que subió el usuario React Tutorials & Tips For ReactJs, d3 Developers 25 noviembre 2020, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 28 veces y le gustó 1 a los espectadores. Disfruta viendo!