Skip to content

Instantly share code, notes, and snippets.

View andrzejewsky's full-sized avatar

Patryk Andrzejewski andrzejewsky

  • Wrocław
View GitHub Profile
import React from "react";
const ListContext = React.createContext();
export default ListContext;
@andrzejewsky
andrzejewsky / withLoadingData.jsx
Last active January 5, 2019 16:46
Loading data
import React, { Component } from "react";
import Loading from "./../components/Loading";
import fetchData from "./../data";
/*
variables - function that returns parameters (based on the component props) for the fetchData()
*/
const withLoadingData = variables => WrappedComponent => {
class WithLoadingData extends Component {
state = {