Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit ec33c97

Browse files
Merge pull request #23 from cybok/readme-contextTypes
Add context info to readme
2 parents 2f414c7 + 3f8f3b4 commit ec33c97

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ Check out the [Drizzle Truffle Box](https://github.com/truffle-box/drizzle-box)
6868
// If Drizzle is initialized (and therefore web3, accounts and contracts), fetch data.
6969
// This will update automatically when the contract state is altered.
7070
var storedData = this.props.drizzleStatus.initialized ? this.contracts.SimpleStorage.methods.storedData.data() : 'Loading...'
71+
72+
// To access drizzle via context in constructor add given context type below
73+
Home.contextTypes = {
74+
drizzle: PropTypes.object
75+
}
7176
```
7277

7378
The contract instance has all of its standard web3 properties and methods. For example, sending a transaction is done as normal:

0 commit comments

Comments
 (0)