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

contexts.RenderContext.tsx Maven / Gradle / Ivy

There is a newer version: 0.80.3
Show newest version
import merge from 'deepmerge';
import { useRenderContext } from 'hooks/render';
import { createContext } from 'react';

export type MultipleRenderType = "mutable-flex" | "mutable-table" | "immutable" 

export type RenderProps = {
  parent?: string
  multipleType?: MultipleRenderType
  context?: string
  props?: any
}

interface RenderContextProps extends RenderProps {
  children: React.ReactNode 
}

export const RenderContext = createContext({} as RenderProps);

const RenderContextProvider = ({children, ...context}: RenderContextProps) => {
  const ctx = useRenderContext()  
  const value: RenderProps = merge.all([ctx, context]) as RenderProps

  return (
    
	   {children}
    
  )
}

export default RenderContextProvider;




© 2015 - 2024 Weber Informatics LLC | Privacy Policy