Sherlock / components / feedContext.tsx
feedContext.tsx
Raw
import React, { useState, createContext } from "react";

const FeedContext = createContext([{}, () => {}]);

const FeedProvider = (props:any) => {
    const [state, setState] = useState<any>([]);

    return (
        <FeedContext.Provider value={[state, setState]}>
            {props.children}
        </FeedContext.Provider>
    );
};

export { FeedContext, FeedProvider };