File size: 407 Bytes
0527ba9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
'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>
    );
};