mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-15 01:01:43 +10:00
integrated html2canvas and jsPDF to generate PDFs
This commit is contained in:
23
src/context/PageContext.js
Normal file
23
src/context/PageContext.js
Normal file
@ -0,0 +1,23 @@
|
||||
import React, { useState } from 'react';
|
||||
|
||||
const PageContext = React.createContext(null);
|
||||
const { Provider } = PageContext;
|
||||
|
||||
const StateProvider = ({ children }) => {
|
||||
const [pageElement, setPageElement] = useState(null);
|
||||
return (
|
||||
<Provider
|
||||
value={{
|
||||
pageElement,
|
||||
setPageElement,
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</Provider>
|
||||
);
|
||||
};
|
||||
|
||||
export const PageProvider = StateProvider;
|
||||
export const PageConsumer = PageContext.Consumer;
|
||||
|
||||
export default PageContext;
|
||||
Reference in New Issue
Block a user