Questions tagged [react]

React (also known as React.js or ReactJS) is a JavaScript library for building user interfaces. It uses a declarative paradigm and aims to be both efficient and flexible.

Filter by
Sorted by
Tagged with
1
vote
0answers
899 views

Strange error when trying to npm start react file [closed]

I get that error while npm start PS C:\Users\Concierge\downloads\prod\pdf2\ipfs_image_uploader> npm start > react-box@0.1.0 start C:\Users\Concierge\downloads\prod\pdf2\ipfs_image_uploader >...
0
votes
1answer
191 views

How would you generate this transaction hash?

let contract = await instance.mint( accounts, usersInput.url, usersInput.metadata[0], usersInput.metadata[1], usersInput.metadata[2], { ...
0
votes
1answer
222 views

How to sign on ethereum a pdf like on this video? [closed]

How to sign on ethereum a pdf like on this video? I'm asking specifically about what happens at 00:40 where you have a user uploading the file and then it get stored and cryptographic signature is ...
1
vote
1answer
2k views

Cannot read property 'eth' of undefined

I want to Interact with my Smart Contract via Web3 and React. But I get a error message with the following code. import React, { Component } from 'react'; import Web3 from 'web3'; let ...
2
votes
0answers
92 views

Use React Dev Tool in developing MetaMask

I am new to MetaMask, and learning how MetaMask works. I found MetaMask UI was implemented with React, so I tried to use React Dev Tool, but I am not able get it working. Please help. I started stand ...
0
votes
1answer
139 views

Server for end production dAPP?

I'm talking for end-production purposes and I'm interested what server specification and which hosting services dAPP developers use. Considering my scenario, I made a decentralized application in ...
1
vote
2answers
279 views

Display Array of struct within array of struct in react

I'm trying to create 2d array of different types, one of the users have suggested to use struct within a struct method -> 2d array of different types? Now I run into problem how to display it in my ...
0
votes
1answer
323 views

“The returned value is not a convertible string” (web3js & React front end)

Edit: to be clear, the getMessage() function works fine in remix. It just doesnt seem to work with my front end. I am trying to set up a front end for my contract but when trying to invoke a certain ...
1
vote
1answer
206 views

Unable to deploy smart contract to rinkeby using ledger wallet?

I am trying to deploy smart contract using ledger wallet. But i keep getting the error cant subscribe to new header. However i get the transaction hash but cant receive the contract instance and ...
0
votes
2answers
162 views

initialise array of struct inside a new struct

Following up on the question of 2d array of different types: 2d array of different types? How would one go about initializing a new array of structs (Vote) when creating a new struct (Project) ...
0
votes
1answer
369 views

Using web3.js in a react redux saga app - uncaught at check call error

I am trying to use Web3.js (Ethereum JavaScript API) in a ReactJS app with Redux / Saga. This is my GetWeb3 function: const GetWeb3 = () => new Promise((resolve, reject) => { window....
0
votes
1answer
531 views

calling function with web3 is not working correctly?

I have a problem like this. I have built a smart contract and have deployed it to the infura network. All other functions are working correctly when interacting with web3 but when I calling one ...
0
votes
1answer
554 views

How to write a component in Drizzle React? [closed]

The components are for the following functions: function tokenURI(uint256 _tokenId) public view returns (string) { require(exists(_tokenId)); return tokenURIs[_tokenId]; } function ...
1
vote
0answers
168 views

How to update react component state with Drizzle

I'm using react and drizzle and want to update the classes state based on data returned from a call to a contract. I'm using the standard pattern from the drizzle box and here (https://itnext.io/how-...
2
votes
1answer
24 views

Smart Contract in website framework?

Let's say you have a Smart Contract which allows users to enter in a list by paying 0.05 ETH How would you implement the front-end / what framework would you choose? For example, I saw someone who ...
0
votes
2answers
224 views

Invalid number of arguments to Solidity function at Object.InvalidNumberOfSolidityArgs (errors.js:25) at

I am always getting this erros with get calls i am using React, Truffle, metamask and Ganache Uncaught (in promise) Error: Invalid number of arguments to Solidity function at Object....
2
votes
1answer
605 views

Unhandled Rejection (TypeError): _this.contarct.getLastName(…).call is not a function

I want to get the customers last name but i get the following error any idea how to fix that ? And is there a way to modify my current get function so that it returns the first name and last name at ...
5
votes
1answer
628 views

Having issues using the Drizzle library in React

Using Ubuntu 16.04 Greetings, all I was following the tutorial for getting Drizzle up and running located here. I advanced to this step when I attempted to run the app using the "npm start" command ...
5
votes
1answer
3k views

Watching Solidity event gives error: TypeError: watch is not a function

I am trying to watch a Solidity event in my React app, but I keep getting the following exception error thrown: TypeError: MyEvent.watch is not a function I am sure the event is present in ...
2
votes
1answer
89 views

Dapp cannot fetch a string

Somehow i cannot get any result from my backend solidity. i have asimple dapp that takes firstName from input field save in blockchain and then fetch it back and display it on the screen. state={ ...
3
votes
2answers
805 views

simple dapp with React “issues with solidity”

i am trying to build a simple app (will improve once i get the simple one to work)I created a new Reactapp, added both the contracts and migrations directories and i use ganache and metamaks. I have ...
2
votes
4answers
3k views

Module not found: Can't resolve './contracts/SimpleStorage.json'

I am new to solidity, truffle and i tried react-box from Truffle and i get the following error. I am using Macos. Here is the basic steps npm install -g truffle truffle develop compile ...
1
vote
2answers
362 views

How to test if user is on the mainnet/testnet using web3?

Hello everyone I need your quick help! I am using web3 1.0.0-beta.34 with React and Next.js and I want to check if user has it Metamask set on mainnet/rinkeby network. I have read quite a few ...
1
vote
1answer
206 views

solidity and react and calling a solidity function many times

I was looking at where i needed to go in my coding, and see i need a pattern to handle the 'many' calls. for example a call only returns 1 set of data, when i need perhaps records 1-70. Is the ...
3
votes
1answer
1k views

Drizzle cacheCall is not updating data correctly

I have a react component which is interacting with a solidity contract via drizzle. I store a cacheCall index in the constructor: this.opcTokenCacheCallIndex = context.drizzle.contracts.OPCToken....
1
vote
1answer
58 views

react-box call of create data function returns invalid address

error image indicates invalid address. this is on the call of the function. Ideas on why it fails? i suspect i'm missing something simple. Function: createCredentialOrg(event){ alert("...
2
votes
1answer
1k views

Truffle react box onChange error: cannot read property 'setState' of undefined

these are the functions that fail: Error: Uncaught TypeError: Cannot read property 'setState' of undefined at createOrgSchoolAddress (App.js:187) when I pasted the address in (third function was ...
2
votes
1answer
83 views

Is React still part of the Truffle framework?

Is React still part of the Truffle framework? Need to set up a truffle project and would like to use React but not sure if it is still part of the truffle framework/family. Thanks, Manj
1
vote
1answer
37 views

react truffle box calling solidity with addresses issues

Repository I've tested the solidity side and things seem to work appropriately. However my hooking up the react box is running into a few problems. I seem to have varying problems related to ...
2
votes
2answers
356 views

Drizzle and mapDispatchToProps not working

I'm still struggling with Drizzle, trying to dispatch my own action. Based on the Drizzle box, I added the following to HomeContainer: import Home from './Home'; import {drizzleConnect} from 'drizzle-...
1
vote
1answer
974 views

Integrating web3 from Metamask in React [closed]

Having trouble integrating web3 from Metamask in React. Metamask version: web3@1.0.0-beta.34 import Web3 from 'web3' let web3; window.addEventListener('load', function () { if (typeof window....
0
votes
1answer
411 views

Comparison of Metamask vs Ganache [closed]

I watched some videos about Metamask but I am so confused by it Metamask: To use the final application like the end user would. Based on that, what is the purpose of React then? What are the ...
1
vote
1answer
591 views

How to get only past 2 days events using getPastEvents everytime?

How can the following query be modified to only fetch the past two days worth of events: const events= await MyContract.getPastEvents("eventName", { fromBlock: 0, toBlock: "latest" });
3
votes
2answers
1k views

How to Listen to Contract Events in Drizzle

Let's take the example of the SimpleStorage contract that comes with the truffle box drizzle-box How can we listen to the event StorageSet and console.log it to the JS console? drizzleOptions.js ...
3
votes
4answers
503 views

React for a dApp

Is it somehow possible to build the front-end side for a DApp using React ? (if i have the back-end code written in solidity and i have no knowledge of solidity? or do i need to learn solidity first )...
2
votes
1answer
488 views

Truffle react with Proxy Contract of OpenZeppelin

Is it possible to create a react app with truffle framework using the Proxy Contract of OpenZeppelin for upgradable contract? What I understood is that one should send a transaction at Proxy ...
1
vote
0answers
217 views

set default amout to transaction

I have a ticket system where you can buy some tickets to an given price. I want to set the amount to the method and send it back to the contract. For this I'm using metamask but I don't really get, ...
1
vote
0answers
103 views

Web3JS + React: Fetching API data to use in a call [closed]

I have the following solidity function: contract testCall { string private globalKey; function setKey(string key) public { globalKey = key; } } As this function is called from ...
1
vote
0answers
164 views

There is any open source for mnemonic (recovery) phrase can be used in react project?

I want to know how to implement 12 words or 24 words mnemonic(recovery) phrase screen as "Create Wallet" part in the ethereum, ERC20 token wallet project built with React Native like as coinomi wallet....
4
votes
2answers
949 views

How can I access the address of a contract in a drizzle dapp?

I've started working from the drizzle box and can access functions within contracts, but if I want to give an allowance to a contract address so it can use users tokens how can I give the correct ...
7
votes
2answers
1k views

Why does sendSignedTransaction return a tx hash BUT does not post to the Rinkeby network (React, Metamask, web3, infura)

I'm developing a very simple React application wherein a user clicks a button and some ether gets sent from one account to another. Currently, the onClick sendEther function crafts a proper signed ...
0
votes
1answer
1k views

How to access web3Instance when using Truffle's Drizzle

I'm working on a dapp with the boilerplate created by running truffle unbox drizzle and need to call functions provided by the web3 instance. Is there a way to access the web3 instance object? All we ...
0
votes
1answer
537 views

Metamask Payment in Reactjs

I'm trying to implement a really basic and simple metamask payment in reactjs. This is what i done, handleClick is triggered by a button: handleClick = () => { let web3 = new Web3(); ...
1
vote
2answers
2k views

Error in unboxing truffle-react on Windows

I am trying to unbox truffle-react but I am stuck with this error: $ truffle unbox react Downloading... Unpacking... Setting up... Error: Command failed: npm install npm WARN deprecated ethereumjs-...
1
vote
0answers
194 views

cannot get return variable(s) in javascript when using require in solidity

I have a function in solidity that returns a few bytes32 variables. I cannot for the life of me access those variables. Can someone please help? function getData() public returns (bytes32, bytes32, ...
0
votes
2answers
2k views

How to connect your react ethereum project with MetaMask wallet?

I am developing a ReactJs blockchain application on ethereum network. How can I use MetaMask Wallet instead of local ganache account. import web3 from 'Web3'; const web3 = new Web3("localurl");
1
vote
2answers
3k views

Create an Ethereum wallet with React Native for single token

Many of you might think that this question has already been answered but I don't think that there is a clear answer on the internet for the current Ethereum, Web3.js and React Native versions (for ...
7
votes
1answer
643 views

Truffle unbox drizzle not working properly

truffle version = 4.1.4 truffle unbox drizzle truffle compile truffle migrate npm run build npm run start this gets me this error: Truffle Drizzle-box fails with TypeError: (0 , _drizzle....
2
votes
1answer
2k views

Web3 not being detected - google chrome extension

I am working on a google chrome extension that operates when a user opens up a new tab. Upon opening a new tab, my dapp should connect to the user's web3 provider. However, no web3 is being detected. ...
3
votes
2answers
24k views

TypeError: Cannot read property 'then' of undefined

I am having an error with Web3. After going through all possibilities I decided to post a question hoping for someone with a solution. The error I keep getting is: TypeError: Cannot read property '...