I’m using Drizzle and react-hooks in my new open source project, but cacheSend outputs always “cacheSend is not a function” This line of code with send works as expected const stackId = contract.methods.createMerchant(value.name, value.category, value.weburl).send({from: drizzleState.accounts[0]}) Instead using cacheSend returns an error “cacheSend is not a function” const stackId = contract.methods[“createMerchant”].cacheSend(value.name, value.category, value.weburl, { from: […]
- Tags [drizzle.store, { from: drizzleState.accounts[0] }) // save the `stackId` for later reference setStackID(stackId) } const getTxStatus, { from: drizzleState.accounts[0] }) Every time I use cacheSend in this project I get the "cacheSend is not a function" error My index.js, { useState } from "react" import { useForm } from "react-hook-form"; const SetMerchant = props => { const [stackId, {useEffect, {useState, }, }; // setup drizzle const drizzle = new Drizzle(options); ReactDOM.render(, but cacheSend outputs always "cacheSend is not a function" This line of code with send works as expected const stackId = contract.methods.c, document.getElementById('root')); This is my App.js where I load my components import React, don't display anything if (!txHash) return null; // otherwise, drizzleReadinessState] ) return ( drizzleReadinessState.loading ? "Loading Drizzle..." : <ReadS, drizzleState } = props const { Coupoken } = drizzleState.contracts const { register, errors } = useForm(); const onSubmit = data => { setValue(data) }; const setValue = value => { const contract = drizzle.contra, Fragment } from 'react' import ReadString from "./ReadString"; import SetString from "./SetString"; import SetMerchant from "./SetMerchant";, grab the state from drizzle const drizzleState = drizzle.store.getState() // check to see if it's ready, handleSubmit, I'm using Drizzle and react-hooks in my new open source project, If so, loading: false}) } }) return () => { unsubscribe() } }, loading: true}) const { drizzle } = props useEffect( () => { const unsubscribe = drizzle.store.subscribe( () => { // e, maxLength: 40 })} /> {errors.category && Use a valid input} <div className=", maxLength: 40 })} /> {errors.weburl && Use a valid input} <input classNa, maxLength: 40})} /> {errors.name && Use a valid input}, pattern: /^[A-Za-z]+$/i, return the transaction status return `Transaction status: ${transactions[txHash] && transactions[txHash].status}` } return ( <di, setDrizzleReadinessState] = useState({drizzleState: null, setStackID] = useState(null) const { drizzle, transactionStack } = drizzleState // get the transaction hash using our saved `stackId` const txHash = transactionStack[stackId], update local component state if (drizzleState.drizzleStatus.initialized) { setDrizzleReadinessState({drizzleState: drizzleS, url: "ws://127.0.0.1:9545", value: 'category' }, value.weburl, value.weburl).send({from: drizzleState.accounts[0]}) Instead using cacheSend returns an error "cacheSend is not a function" const stackId =, watch, web3: { fallback: { type: "ws"