added float contaxt , action can take form any component

This commit is contained in:
Pramod Mahajan 2025-05-28 11:59:12 +05:30
parent cae2f2fffd
commit cea094cd89

View File

@ -0,0 +1,15 @@
import React, { createContext, useContext, useState } from "react";
const FabContext = createContext();
export const FabProvider = ({ children }) => {
const [actions, setActions] = useState([]);
return (
<FabContext.Provider value={{ actions, setActions }}>
{children}
</FabContext.Provider>
);
};
export const useFab = () => useContext(FabContext);