I am using the following Drizzle (Truffle) component to call a function from a smart contract:
<ContractData contract="Market" method="priceOf" methodArgs={this.props.id}/>
The result is a React Element that contains number in Wei: 4000000000000000
Now, I am saving this in the state, and this is rendered when this.state.price
is rendered.
However, when I want to pass {this.state.price}
as props price={this.state.price}
, it does not work, the error message is that the React element can't be cloned.
Is there any way to get/parse/query/copy the raw data of the React Element? I need that 4000000000000000
as a number (Number()
and parseInt()
are giving NaN
, toString()
gives [object Object]
)