nexora / frontend /src /context /FilmContext.js
ChandimaPrabath's picture
update
0527ba9
raw
history blame
407 Bytes
'use client';
import { createContext, useState, useContext } from 'react';
const FilmContext = createContext();
export const useFilmContext = () => useContext(FilmContext);
export const FilmProvider = ({ children }) => {
const [films, setFilms] = useState([]);
return (
<FilmContext.Provider value={{ films, setFilms }}>
{children}
</FilmContext.Provider>
);
};