File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -87,8 +87,10 @@ const IDEView = (props) => {
8787
8888 const autosaveIntervalRef = useRef ( null ) ;
8989
90+ const location = useLocation ( ) ;
91+
9092 const prevFileNameRef = useRef ( selectedFile . name ) ;
91- const locationRef = useRef ( props . location ) ;
93+ const locationRef = useRef ( location . pathname ) ;
9294
9395 const syncFileContent = ( ) => {
9496 const file = cmRef . current . getContent ( ) ;
@@ -110,7 +112,7 @@ const IDEView = (props) => {
110112 // for setting previous location
111113 useEffect ( ( ) => {
112114 dispatch ( setPreviousPath ( locationRef . current . pathname ) ) ;
113- } , [ props . location ] ) ;
115+ } , [ location . pathname ] ) ;
114116
115117 // For autosave
116118 useEffect ( ( ) => {
@@ -273,9 +275,6 @@ IDEView.propTypes = {
273275 project_id : PropTypes . string ,
274276 username : PropTypes . string ,
275277 reset_password_token : PropTypes . string
276- } ) . isRequired ,
277- location : PropTypes . shape ( {
278- pathname : PropTypes . string
279278 } ) . isRequired
280279} ;
281280
You can’t perform that action at this time.
0 commit comments