Install and use Material UI with next.js 14 (Typescript)
Unanswered
Yellowstripe scad posted this in #help-forum
Yellowstripe scadOP
I'm looking for the best way how to install mui package with the new app router.
I'm starting from a fresh next.js 14 typescript app.
each thing and guide i try gets lots of errors.
in addition i want to have the light theme and dark theme prepered to use.
please help as im stuck on it for over a week ðŸ™
I'm starting from a fresh next.js 14 typescript app.
each thing and guide i try gets lots of errors.
in addition i want to have the light theme and dark theme prepered to use.
please help as im stuck on it for over a week ðŸ™
15 Replies
Segugio Italiano
You should probably provide some details on what you have tried.
@Segugio Italiano You should probably provide some details on what you have tried.
Yellowstripe scadOP
i have tried to use the official mui install from:
https://mui.com/material-ui/guides/next-js-app-router/#example
and some various youtube / github repos but non of them are for next 14
https://mui.com/material-ui/guides/next-js-app-router/#example
and some various youtube / github repos but non of them are for next 14
Segugio Italiano
And your error?
@Segugio Italiano And your error?
Yellowstripe scadOP
for example the following error on simple dropdown menu:
and thanks for the fast replay! really appriciated
and thanks for the fast replay! really appriciated
Segugio Italiano
I don't mean to be rude. But did you add "use client" to your file?
That error has nothing to do with Material UI.
Yellowstripe scadOP
im converting from next 12 so this is a new concept that im trying to understand
probably i did not understood it correctly
Segugio Italiano
At the top of your file put
'use client'sorry typo
Anyways, this portion worked for me:
@Yellowstripe scad im converting from next 12 so this is a new concept that im trying to understand
Segugio Italiano
If you are converting an exisiting site, maybe just focus on the conversion portion and then come back to adding material UI later?
@Segugio Italiano If you are converting an exisiting site, maybe just focus on the conversion portion and then come back to adding material UI later?
Yellowstripe scadOP
im starting a fresh website (for new app), im used to next 12 and i understood that most concepts are diffrent and the use client is new to me
iv just added it and it worked so tanks alot!!!
i will read the docs again