FaasJS
Home
  • Guide
  • Documents
  • Templates
  • Changelog
  • Ecosystem

    • Docker Images
  • Github
  • Contributing
  • Sponsor
  • Security
Home
  • Guide
  • Documents
  • Templates
  • Changelog
  • Ecosystem

    • Docker Images
  • Github
  • Contributing
  • Sponsor
  • Security

Documents / @faasjs/ant-design / ConfigContext

Variable: ConfigContext

const ConfigContext: Context<ConfigContextValue>

Low-level React context that stores the resolved theme from ConfigProvider.

Most app code should call useConfigContext instead of reading this context directly.

Example

import { ConfigContext, ConfigProvider } from '@faasjs/ant-design'
import { useContext } from 'react'

function OrdersHeader() {
  const { theme } = useContext(ConfigContext)

  return <h1>{`Orders - ${theme.Title.suffix}`}</h1>
}

export function OrdersPage() {
  return (
    <ConfigProvider
      theme={{
        common: { blank: 'No orders yet' },
        Title: { suffix: 'Acme Admin' },
      }}
    >
      <OrdersHeader />
    </ConfigProvider>
  )
}