0
私はreactjsの新機能です - 言語切り替えのあるサイトで作業しています404ページとして使用するエラーコンポーネントを作成しようとしていますが、パラメータが定義されていない場合はデフォルトの言語を使用するようにサイトを自動的に設定/設定したり、エラーパスを設定してlangパラメータをリッスンします。reactjs - 404ページ - 言語paramには処理の問題があります
router.js現在この
<Switch>
<Route exact path='/' render={() => (<Redirect to='/de/dienstleistungen/geistiges-eigentum' />)} />
<Route path='/:langURL/services' component={Services} />
<Route path='/:langURL/dienstleistungen' component={Services} />
<Route path='/services' component={Services} />
<Route path='/:langURL/how-it-works' component={HowItWorks} />
<Route path='/:langURL/anleitung' component={HowItWorks} />
<Route path='/:langURL/features' component={Features} />
<Route path='/:langURL/funktionen' component={Features} />
<Route path='/:langURL/beliebte-projekte' component={BundleDetails} />
<Route path='/:langURL/popular-projects' component={BundleDetails} />
<Route component={Error} />
</Switch>
私はパスに誤差成分にルートパスを設定している場合=「/:?langURL」 - それでもエラーコンポーネントを有効にしますか? –
ルートに既にリダイレクトがあります/ - - –