You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importstylefrom'./Test.module.css'constTest=()=>{return(<divclassName={style.Test}>
Test style
</div>)}exportdefaultTest
app/component/Test/Test.module.css
.Test {
background:#ff9100;
color:#fff;
}
Create new route file
app/routes/test.tsx
importtype{MetaFunction}from"@remix-run/node";importTestfrom'~/component/Test'import{Link}from'@remix-run/react'exportconstmeta: MetaFunction=()=>{return[{title: "Test page"},];};exportdefaultfunctionIndex(){return(<divstyle={{fontFamily: "system-ui, sans-serif",lineHeight: "1.8"}}><h1>Welcome to Remix</h1><ul><li><Linkto={'/'}>
Index
</Link></li></ul><Test/></div>);}
Use Test component on index route & apply Link to /test route
_app/routes/index.tsx
importtype{MetaFunction}from"@remix-run/node";importTestfrom'~/component/Test'import{Link}from'@remix-run/react'exportconstmeta: MetaFunction=()=>{return[{title: "New Remix App"},{name: "description",content: "Welcome to Remix!"},];};exportdefaultfunctionIndex(){return(<divstyle={{fontFamily: "system-ui, sans-serif",lineHeight: "1.8"}}><h1>Welcome to Remix</h1><ul><li><Linkto={'/test'}>
Test
</Link></li><li><atarget="_blank"href="https://remix.run/tutorials/blog"rel="noreferrer">
15m Quickstart Blog Tutorial
</a></li><li><atarget="_blank"href="https://remix.run/tutorials/jokes"rel="noreferrer">
Deep Dive Jokes App Tutorial
</a></li><li><atarget="_blank"href="https://remix.run/docs"rel="noreferrer">
Remix Docs
</a></li></ul><Test/></div>);}
Run npm run build && npm run start
Expected Behavior
Test component should have orange background and white font color on routes / and /test. There should be have 1 css file on inside <head> tag.
Actual Behavior
Test component don't have styles, component have it's class on DOM but css file missing from <head> tag.
The text was updated successfully, but these errors were encountered:
What version of Remix are you using?
2.2.0
Are all your remix dependencies & dev-dependencies using the same version?
Steps to Reproduce
Create a clean project
Create a Test component with css-modules:
app/component/Test/index.tsx
app/component/Test/Test.module.css
Create new route file
app/routes/test.tsx
Use Test component on index route & apply Link to /test route
_app/routes/index.tsx
Run
npm run build && npm run start
Expected Behavior
Test component should have orange background and white font color on routes / and /test. There should be have 1 css file on inside
<head>
tag.Actual Behavior
Test component don't have styles, component have it's class on DOM but css file missing from
<head>
tag.The text was updated successfully, but these errors were encountered: