Can't access contract data in HomeContainer
petscheit opened this issue · 4 comments
I'm having issues with getting the contract data from redux. I've changed the HomeContainer to import Home.bak to play around with getting some data by hand, without the components. The problem I'm having is getting the storedData to show up in the state.
this is my HomeContainer.js:
import Home from './Home.bak'
import { drizzleConnect } from 'drizzle-react'
const mapStateToProps = state => {
console.log(state)
return {
accounts: state.accounts,
SimpleStorage: state.contracts.SimpleStorage,
TutorialToken: state.contracts.TutorialToken,
drizzleStatus: state.drizzleStatus
}
}
const HomeContainer = drizzleConnect(Home, mapStateToProps);
export default HomeContainer
When I print the value here, the storedData object is empty. On the flip side, if I check with the redux-devtool, storedData contains the value i'm looking for.
Another thing that is confusing me, is the fact that I'm able to get the proper dataKey (0x0) in Home.bak, though I have a feeling that it's the default return value.
@petscheit How are you accessing the storedData object?
I found a good explanation here: https://itnext.io/how-to-use-drizzle-truffle-and-react-to-make-the-best-front-end-for-your-ethereum-dapp-ee09c8e94eae
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been closed, but can be re-opened if further comments indicate that the problem persists. Feel free to tag maintainers if there is no reply to further comments.