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 |