Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
Tags
- UI
- frontend
- Docker
- python
- PyTorch
- js
- Git
- ML
- C++
- react
- ps
- GAN
- figma
- Linux
- Three
- html
- PRISMA
- backend
- API
- mongo
- CSS
- review
- postgresql
- ts
- DB
- Express
- vscode
- CV
- nodejs
- SOLID
Archives
- Today
- Total
아카이브
[Solid] 페이지 라우팅 설정하기 본문
Solid-Meta와 Solid-Router를 사용합니다.
App.tsx
import Pages from './pages';
const App: Component = () => {
return (
<MetaProvider>
<Router>
<Route>
<Pages/>
</Route>
</Router>
</MetaProvider>
);
};
/Pages/index.tsx
const Pages = () => {
return (
<>
<Route path="/" component={MainPage} />
<Route path="/path1" component={path1Page} />
<Route path="/path2" component={path2Page} />
{/* ... */}
</>
)
}
export default Pages
index.tsx 파일이 있다면 다른 곳에서 Pages 폴더만 호출해도 index.tsx가 기본 파일로 호출되기 때문에,
Pages 컴포넌트를 불러올 수 있습니다.
728x90
'Frontend > SolidJS' 카테고리의 다른 글
[Solid] Solid-Router: 페이지 라우팅 설정하기 (0) | 2025.02.08 |
---|---|
[Solid] Solid-Meta: 메타데이터 다루기 (0) | 2025.02.08 |
[Solid] Syntax | 13. Resource (0) | 2025.01.31 |
[Solid] Solid Start에 대해서 (0) | 2024.07.09 |
[Solid][CSS] SolidJS에서 macaron 사용하기 (0) | 2024.07.01 |