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

Last updated