我正在构建一个React-Netlify Function应用程序。该应用程序正在使用react-router-dom路由到页面。
import React from 'react';
import {
Switch,BrowserRouter as Router,Route,Link,Redirect,withRouter,browserHistory
} from 'react-router-dom';
...
<Router history={browserHistory}>
<IdentityContextProvider url={url}>
<Page>
<Switch>
<Route exact path="/" component={withTracker(HomePage)} />
<Route exact path="/demo" component={withTracker(Demo)} />
但是,当用户直接在浏览器地址栏中键入URL进入链接时,它显示为未找到。这是否意味着我还需要服务器端渲染?将服务器端渲染添加到现有应用程序的最快方法是什么?
我们计划将不同的广告指向网站的不同页面链接。