0

I'm trying to make work drizzle's ContractForm with custom render of inputs, sadly, I can't trigger submit, code looks as follows:

EDIT: Figured it out, given code should work.

<ContractForm
    style={{padding: '10px'}}
    drizzle={drizzle}
    contract="Offers"
    method="addOffer"
    sendArgs={{gas: 600000}}
    labels={["To Address", "Amount to Send"]}
    render={(inputs) => (
        <AddOffer inputs={inputs}/>
    )}
/>

In the render of AddOffer component I got

    render() {
        let inputs = this.props.inputs;
        return (
            <div>
                tokenAddress:
                <Input
                    name={inputs.inputs[0].name}
                    onChange={inputs.handleInputChange}
                    type={inputs.inputs[0].type}/>

                tokenAmount:
                <Input  
                    name={inputs.inputs[1].name} 
                    onChange={inputs.handleInputChange}
                    type={inputs.inputs[1].type}/>

                <Button onClick={inputs.handleSubmit}>Submit</Button>
            </div>
        )
    }

I have tried to make it work in few ways but none were working.

Cheers! <3

Your Answer

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

Browse other questions tagged or ask your own question.