import React from 'react'; import { Route, Switch, withRouter, matchPath } from 'react-router-dom'; import 'bootstrap/dist/css/bootstrap.css'; import { Row, Col, Button, Collapse } from 'react-bootstrap'; import TopBar from './TopBar'; import VideoPlayer from './VideoPlayer'; import VideoInfo from './VideoInfo'; import VideoList from './VideoList'; import Suggestion from './areainfo/Suggestion'; import { ReactHeight } from 'react-height'; import './css/App.css'; class App extends React.Component { state = { playerHeight: null, navHeight: null, blackbgHeight: null, isInfoToggled: false, videoId: localStorage['lastId']?localStorage['lastId']:'0J2QdDbelmY' }; // componentDidMount(){ // } // componentDidUpdate(prevProps, prevState) { // } static getDerivedStateFromProps(nextProps, prevState) { let idMatch = matchPath(nextProps.location.pathname, { path: "/video/:id", exact: true, strict: false }); if(idMatch && idMatch.params.id !== prevState.videoId){ localStorage.setItem('lastId', idMatch.params.id) return {videoId: idMatch.params.id }; } return null; } render() { return ( { this.setState({ navHeight: height }); }}> this.setState({ blackbgHeight: height })} className="row upperSection p-2 px-5" > this.setState({ playerHeight: height })}>
URL not found
} />
); } } export default withRouter(App);