Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [react]

The tag has no usage guidance.

0
votes
1answer
13 views

Props object value not flowing to next page [on hold]

I am unable to figure out why the props.query.address is returning "undefined". I am using next.js for routing. Please have a look at below screenshot, Please note the highlighted route, When i ...
1
vote
0answers
28 views

How to get the returned value of a smart contract function when it called by using cacheSend() in drizzle

I just tried to build a simple DApp using truffle, react and drizzle. My question is how to get the returned value of a smart contract function when it called by using cacheSend() in drizzle? As ...
0
votes
0answers
32 views

Web3 is injecting but stilling getting an invalid provider error

I'm injecting web3 with MetaMask, and everything works, but when I make a production build, I notice that it injects web3 alright, but when I try to call a web3 function, it throws `Please provide an ...
0
votes
1answer
33 views

Unhandled Rejection (Error): invalid string value (arg=“x”, coderType=“string”, value=5)

Using Truffle unbox react to unbox a boilerplate. received the following error from running npm run start Changes: Addition of "memory" parameters in the simpleStorage.sol Changed unit to string in ...
0
votes
0answers
14 views

How do I solve this error involving web3 and webpack in my truflle-react box based project?

The project is a truffle-react trufflebox, a bounties creating and solving application. It uses Truffle v5.0.1. This is the home page. Below is the page that displays when you click on the 'Become a ...
1
vote
1answer
58 views

Metamask transaction confirmed but “Internal JSON RPC error”

I am using getWeb3() to instantiate a contract and make calls with, the transaction says that is confirmed but when I open up developer tools there is the following error MetaMask - RPC Error: ...
0
votes
0answers
8 views

react-uport truffleBox not showing the QR for login?

After copy and paste the code given while creating an app in app-manager in uport.appmanager.me const uport = new Connect("Auction Protocol ", { clientId: "****", network: "rinkeby", signer: ...
1
vote
1answer
46 views

Getting all past events in web3JS

I have seen similar questions here, but the answers didn't help so far. I have a JS function in a React component that should parse all the past events of the contract. The function is invoked in ...
0
votes
1answer
21 views

How to send context from DrizzleContext.Provider to a Class Component / Class Container

I'm using the new Context API supported 'drizzle-react' library in my dapp. Can anyone please clarify how to receive the context sent from DrizzleContext.Provider into a "class" component? Check out ...
0
votes
1answer
182 views

Could not find “store” in either the context or props of “Connect(c)”. Either wrap the root component in a <Provider>

i'm trying to create a drizzle-react app which uses the new DrizzleContext component but running the following error in my 'localhost:3000': > Could not find "store" in either the context or ...
0
votes
1answer
72 views

React: Please pass numbers as strings or BigNumber objects to avoid precision errors

Here is my onSubmit function: onSubmitModifyAllocation = async event => { event.preventDefault(); const accounts = await web3.eth.getAccounts(); await fund.methods.modifyAllocation(this....
0
votes
1answer
91 views

JSON RPC call from javascript with axios

I would like to call a geth method via JSON RPC from within a react component. I tried this but I always get the Error: 405 (Method Not Allowed) Here is my code: try { const response = await ...
2
votes
0answers
33 views

this.contract.deployed() is not a function

I'm working on making a React frontend for my smart contract, but I'm having problems connecting it into my React code. Here are the relevant portions of my code: import TruffleContract from '...
0
votes
1answer
230 views

Truffle migrate no error but does not create build directory

I'm trying to develop a simple dapp using ReactJS.I used Charterhouse/truffle-create-react-app box suggested by truffle website. The problem is truffle compile and truffle migrate do not seem to work. ...
0
votes
0answers
20 views

solc/wrapper not working with reactjs

My compile.js code: var wrapper = require('solc/wrapper') var solc = wrapper(window.Module) const Compile = (code,name) => { return solc.compile(code, 1).contracts[':'+name]; }; export default ...
2
votes
1answer
85 views

Call a function with an address attached (Solidity React)

I'm trying to make a frontend of calling a function with an address attached: function getAvailableAllocation(address _addr) constant returns (uint ethAvailableAllocation) { return ...
1
vote
2answers
54 views

Payable function with additional value attached (web3, React)

I'm making a React frontend for an open-source blockchain protocol for tokenized hedge funds. So the question is how to provide the payable function that requires some other value attached (n this ...
2
votes
1answer
60 views

contract sendTransaction does not return transaction hash

I just started with truffle react box.. and i changed a little bit to : const tx = await instance.set.sendTransaction(999,{from : accounts[0]}); console.log("tx is on the way : ",tx); const txReceipt ...
1
vote
2answers
55 views

Why is browser taking so long to read blockchain data?

I have a dAPP and I use reactjs for the frontend. The application returns data from a smart contract (the balance) on the homepage. The main problem that I notice is that everytime I or any other ...
0
votes
1answer
290 views

The send transactions “from” field must be defined!

I am trying to call a function of a contract that has been deployed to Ganache. I am trying to call a function that makes payouts to a few addresses and can be called by owner only. When I am calling ...
1
vote
0answers
342 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
56 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
42 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
136 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
45 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
31 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
55 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
127 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
58 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
44 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
144 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
147 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
219 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
93 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
17 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
77 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
133 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 ...
4
votes
1answer
265 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 ...
2
votes
1answer
311 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 ...
1
vote
1answer
44 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
258 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 ...
1
vote
4answers
855 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
80 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
72 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
313 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
37 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
567 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
59 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
28 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
184 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-...