1

I am building a DAPP based on drizzle box. I am struggling to find out how can i get the web3 instance without initiating a new one I want to end up with something like :

this.props.web3.eth

Thanks

3

As described here : https://github.com/trufflesuite/drizzle-react/issues/22

This can be done via:

this.context.drizzle.web3...

In order to make this work, you have to pass the context variable to the constructor:

constructor(props, context) {
super(props)
...
}

and make shure you added drizzle to your context-types:

ExampleComponent.contextTypes = {
  drizzle: PropTypes.object
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.