All Downloads are FREE. Search and download functionalities are using the official Maven repository.

contexts.SubmitContext.tsx Maven / Gradle / Ivy

import { createContext, useState } from 'react';
import { SetState } from 'types/react';

export interface SubmitProps {
  setSubmitting: SetState,
  submitting: boolean,
}

export interface SubmitProvidedProps {
  children: React.ReactNode,
}

export const SubmitContext = createContext({
  submitting: false,
  setSubmitting: () => { console.error("Submit context provider is not initialized") }
})

const SubmitProvider = ({children}: SubmitProvidedProps) => {
  const [submitting, setSubmitting] = useState(false)

  return (
    
      {children}
    
  )
}

export default SubmitProvider       




© 2015 - 2024 Weber Informatics LLC | Privacy Policy