Answer the question
In order to leave comments, you need to log in
How do you know in React that a component has mounted?
There is a code:
import React, {Component} from 'react';
import {Route, Switch} from 'react-router-dom';
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
import ContentIndex from '../pages/ContentIndex';
import Catalog from '../pages/Catalog';
class Root extends Component {
render(){
return(
<div className="all-data">
<Switch>
<Route
exact
path={"/"}
component={ContentIndex}
/>
<Route
path={'/catalog'
component={Catalog}
/>
</Switch>
</div>
)
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question