我正在尝试使用 React 设置验证帐户,并在我的App.js文件中包含以下内容
应用程序.js
import SigninPage from './pages/signin';
import ResetPasswordPage from './pages/resetPassword'
import VerifyAccountPage from './pages/verifyAccount'
...
...
import { useHistory } from 'react-router';
import { logout } from './utils/auth';
function App() {
const history = useHistory();
return (
<Router>
<Switch>
<Route path='/' component={Home} exact />
<Route
path="/signout"
render={() => {
logout();
history.push('/');
return null;
}}
/>
<Route path='/signin' component={SigninPage} exact />
<Route path='/reset-password?reset-password-token=:resetPasswordToken' component={ResetPasswordPage} />
<Route path='/verify-account?token=:token&email=:email' component={VerifyAccountPage} exact />
</Switch>
</Router>
);
}
export default App; …Run Code Online (Sandbox Code Playgroud) 我将使用 React.js 库构建一个可嵌入的小部件。我使用命令“parcel build src/index.js --no-source-maps -d widget”成功构建了小部件。但是,当运行任何网站中内置的 js 和 css 文件时,我遇到了错误“Uncaught Error: Minified React error #299”。我研究了很多博客,但没有找到解决方案。如果您有经验,请告诉我解决方案。