Categories
Mastering Development

Positioning dynamically assigned Script object in div

I have an issue with React/Next and Coupang Partners Banner Ads. I am trying to dynamically assign Coupang Scripts in a Div. But the Coupang ad container is out of the Div box. I cannot customize the location. dynamicScript.js import React, { useEffect, useRef, useState } from ‘react’; import PropTypes from ‘prop-types’; // Usage const […]

Categories
Cryptocurrency Ethereum Mastering Development

My Crowdsale contract wont transfer ERC20 tokens and all transactions fail

I have a crowdsale contract that recieves tokens directly from a mint function in my token contract.the function mints the tokens and sends its to the Crowdsale account address. when I run let token = await Token.deployed() await token.mint(‘0xc2646F5bcB2B59a3AB3E6ccD1806D8be241C4A94’,50000000000000) In the truffle console. I get a tx hash and a transfer event. After that I […]

Categories
Mastering Development

Lightning chart crashes with t.toFixed is not a function

I am using a lightningchart by arction to plot a bar graph and it keeps crashing after adding the rectangle figures with an error message t.toFixed is not a function The series being used is a rectangle series and I’d like to use only one rectangle series because I need them all under one group […]

Categories
Mastering Development

While iterating the array, the records are not completely displaying in react hooks page

While iterating using map function in react-hooks, array data is not properly displaying in the page, I could see the array has got 3 records, but while iterating it is displaying only two records and that too same image got displayed twice. Could someone please help me to identify the issue here ? I can […]

Categories
Mastering Development

While trying to edit, system throws Cannot read property ‘0’ of null

While trying to edit any of text fields throws error Cannot read property ‘0’ of null and the image also not updating to the database. Added a screen shot TypeError: Cannot read property ‘0’ of null handleChange C:/Project/soccerpep/src/components/Profile.js:67 import React, {useEffect, useState } from "react"; import { useForm } from ‘react-hook-form’; import { useHistory } […]

Categories
Mastering Development

What could cause html select element not to render on the browser?

I have a form in my react project with few input tags and select tags. On the browser the inputs are rendering but the select tags are not rendering. I am materialize css for the styling. I inspect the elements, the select element is showing on the elements inspection pane and there is no console […]

Categories
Mastering Development

Set title onSubmit based on current SELECT OPTION VALUE – react

I found this tutorial on how to create a react quizz app on youtube link to tutorial I am trying to set the title based on the current Select Option Value when submitting the form. Currently I managed to change the title only when a different option is selected. import React, { useState, useEffect, useRef […]

Categories
Cryptocurrency Ethereum Mastering Development

Drizzle cacheSend outputs “cacheSend is not a function” error, but the tx works when using send

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: […]

Categories
Mastering Development

How to optimally update state from parent in double nested child componenet (with hooks)?

Link to video with issue outlined below! Hello, currently my issue is that, when I click the DeleteButton (found in the SortableItem component), while the mutation successfully works, it requires a refresh to show the deletion. What would be the most optimal way to refresh this as soon as the DeleteButton mutation is run? I […]

Categories
Mastering Development

Why is the data being logged 4 times?

I’m using redux and hooks. I want to get data from redux. It’s coming but 4 times. I think this situation is bug. How to fix? Is incorrect method i was use. import React, { useEffect, useState } from ‘react’; import { connect } from ‘react-redux’ import { getProductDetail } from ‘../../redux/actions/products/productActions’ function ProductDetail({ product, […]