This is my login page (App.jsx) I am trying to navigate to the dashboard after a successful login. But it is not navigating as expected. I want to know if it is possible from an external page ( App.jsx) Navigate to the routing page (Dashboard.jsx).
import React from'react';
import createHistory from'history/createBrowserHistory' ;
const history = createHistory();
export default class App extends React.Component {
constructor(props){
super(props);
this.state = {}
}
goToDashboard(e){
this.props.history.push('/employeelist') ;
}
render() {
return (
I include all content in higher-level components (App), And routing inside the App component. In this way, you can more easily build the path and swap out the children as needed.More or less like this;
This is my login page (App.jsx). I am trying to navigate to the dashboard after a successful login. But it is not navigating as expected. I want to know if it is possible to navigate from an external page (App.jsx) to the routing page (Dashboard. jsx).
import React from'react';
import createHistory from'history/createBrowserHistory';
const history = createHistory();
export default class App extends React.Component {
constructor(props){
super(props);
this.state = {}
}
goToDashboard(e){
this.props.history.push('/employeelist');
}
render() {
return (
);
}
}
App.contextTypes = {
router: React.PropTypes.object.isRequired
}This is my dashboard page (Dashboard.jsx)
import React from'react';
import App from './App.jsx';
import EmployeeRegister from'./EmployeeRegister.jsx';
import EmployeeList from'./EmployeeList.jsx';
import {HashRouter, Route, Link} from'react-router-dom';
export default class Dashboard extends React.Component{
render(){
return(
(
WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 5984 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC