Q3
  • Introduction
  • Related Projects
  • Roadmap
  • API
    • Core
      • Rest
      • Session
      • Schema plugins
    • Schemas
      • Rates
      • Rebates
      • Permissions
    • Utils
      • Subdocuments
      • Soft deleting
  • Client
    • gatsby-theme-q3
    • q3-components
      • Quantity
    • q3-ui-cart
      • Drawer
    • Admin
      • Builders
      • Containers
        • Contexts
    • Datatables
      • TableBadge
    • Forms
      • Field
      • Presets
        • <PasswordChange />
    • Repeater
    • UI
      • CallToAction
      • Avatar
      • CollapsiblePanel
      • SubMenu
Powered by GitBook
On this page
  • Example
  • API

Was this helpful?

  1. Client
  2. Admin
  3. Containers

Contexts

Example

Note that re-renders occur when using the Store Context. Both Definitions and Dispatchers use the changedBits parameter to block re-rendering in the tree. This way, components can update the Store Context without incurring the side-effects.

import React from 'react';
import { Definitions, Dispatch, Store } from 'q3-admin/lib/containers';

const StatefulComponent = () => {
    const defs = React.useContext(Definitions);
    const dispatchers = React.useContext(Dispatch);    
    const datastore = React.useContext(Store); 
    return null;
}

API

Definitions Context Consumer

Prop

Type

Description

PreviousContainersNextDatatables

Last updated 5 years ago

Was this helpful?