I'm using the new Context API supported 'drizzle-react' library in my dapp. Can anyone please clarify how to receive the context sent from DrizzleContext.Provider into a "class" component? Check out the example index.js file below. Imagine the < App /> component is a "class" component and not a "function component". For a "function" component, i guess it is pretty straightforward - use < DrizzleContext.Consumer >. But how to get the context (drizzle = {drizzle}) inside the class component ? I tried giving a constructor with context prop like this:
constructor(props,context) {...}
but this doesnt work. Any ideas ?
my index.js looks like this:
<!-- language: lang-jsx -->
import React from 'react';
import ReactDOM from 'react-dom';
import { Drizzle, generateStore } from "drizzle";
import { DrizzleContext } from "drizzle-react";
import { LoadingContainer } from 'drizzle-react-components'
import './index.css';
import App from './App';
//import * as serviceWorker from './serviceWorker';
import drizzleOptions from './drizzleOptions';
const drizzleStore = generateStore(drizzleOptions);
const drizzle = new Drizzle(drizzleOptions, drizzleStore);
ReactDOM.render(
(<DrizzleContext.Provider drizzle={drizzle} >
<App />
</DrizzleContext.Provider>),
document.getElementById('root')
);