Skip to content

Instantly share code, notes, and snippets.

View watadarkstar's full-sized avatar
🏠
Working from home

Adrian Carolli watadarkstar

🏠
Working from home
View GitHub Profile
import React, { useEffect } from 'react';
import PropTypes from 'prop-types';
function withScrollToTop(Component) {
function Wrapped({ location, ...rest }) {
const { pathname } = location;
useEffect(() => {
window.scrollTo(0, 0);
}, [pathname]);
import React from 'react';
import { render, cleanup } from 'react-testing-library';
import { AppsNav } from '.';
describe('<AppsNav />', () => {
afterEach(cleanup);
const history = {
listen: jest.fn(),
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const React = require('react');
const CompLibrary = require('../../core/CompLibrary.js');