TypeError: Cannot read property 'Provider' of undefined
fdervillez opened this issue · 2 comments
Hello,
I a new user of drizzle and I installed the truffle drizzle box. Everything's OK.
But when I try to use <DrizzleContext.Provider drizzle={drizzle}>
following the example listed in the readme file of this module,
I keep on getting this error "TypeError: Cannot read property 'Provider' of undefined"
Here is the code I use:
import React, { Component } from 'react'
import ReactDOM from 'react-dom';
import drizzleOptions from './Options'
import { Drizzle, generateStore } from "drizzle";
import { DrizzleContext } from "drizzle-react";
import App from './layouts/home/App'
const drizzleStore = generateStore(drizzleOptions);
const drizzle = new Drizzle(drizzleOptions, drizzleStore);
ReactDOM.render((
<DrizzleContext.Provider drizzle={drizzle}>
</DrizzleContext.Provider>
),
document.getElementById('root')
);
The drizzle-react & drizzle packages are well installed and running with the drizzle truffle box. the react version is 16.7.0 so above the minimum version level as indicated in the readme file.
Is there any bug or am I lacking something?
Thanks a lot for your help/
The Drizzle box was re-written pretty recently, can you try it again?
Closing this for now, as @adrianmcli mentioned we've rewritten the drizzle-box
and that might be a fix. If the issue persists with the most recent box, please reopen!