Skip to content
Advertisement

Tag: reactjs

in react file upload not working properly

If you select any file its working perfectly but after selecting any file again if you click choose file button and not select any file then error occur “Cannot read properties of undefined (reading ‘name’)” how to resolve this error. I also gave filename===undefined but its not working Answer Multiple issues in your code. Please read on. The first rule

react-i18next ignores options parameter

I wanted to organize better the language translation files of my project having to nest objects in the language file. Without nesting everything works fine Even nesting objects I can access them by passing the attribute directory in the t() function (ie: t(‘section.subsection.text’) Documentation’s solution doesn’t work for me and I don’t know why I already tried printing the useTranslation

React get value from a class

I have a component where i get the distance from one point to another, with Google Maps (DirectionsRenderer). What i want, is to use this data in a h1 This is my return EDIT: ShowProduct.js (This is where i get the distance) ProductCard.js (This is where want to use it) Answer You need to set up a state using useState

Render div with state only on phones

is there some way how to render div conditionally with state but only for mobiles? I have show more button, but i need it only for phone resolution, also I need to display that div with className text every time on desktop Answer you can set the active class in the media query. At first, you can this div display

Paypal dynamic value in react js

I need help with my project I want to add a dynamic option to the PayPal payment process. ( change the value to be dynamic ) the default option is value: ‘0.01’ and the dynamic payment in my project is cart.subtotal.formatted_with_symbol I try to add [const {amount} = cart.subtotal.formatted_with_symbol;] this line to try to change the value to value: amount

Advertisement