Skip to content

Instantly share code, notes, and snippets.

@productioncoder
Last active November 25, 2018 12:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save productioncoder/f5a3671c6b4e2977a5a36a9a074d02e3 to your computer and use it in GitHub Desktop.
Save productioncoder/f5a3671c6b4e2977a5a36a9a074d02e3 to your computer and use it in GitHub Desktop.
Youtube in React: enforce scrolling to top in AppLayout component
import React from 'react';
import './AppLayout.scss';
import HeaderNav from '../../containers/HeaderNav/HeaderNav';
import ScrollToTop from '../ScrollToTop/ScrollToTop';
export function AppLayout(props) {
return (
<ScrollToTop>
<div className='app-layout'>
<HeaderNav/>
{props.children}
</div>
</ScrollToTop>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment