Category "reactjs"

How to find declaration for my typescript/react module?

I am very (very) new in frontend technologies, specially react and typescript. My issue come when trying to do a simple thing that is to use a react component

How to sort data in ascending or descending order in Reactjs?

I have products data which I am importing in my displaycomponent. For each product in JSON I am using .map() to display the content. Now I want to sort the prod

How to get updated state from Redux store using redux-toolkit after component has already rendered?

The functionality I am looking for is that of an e-commerce website. A click on the add-to-cart button adds product to cart. I am able to successfully achieve t

Issue with Web3.js, try to call he contract to see the state

Hi everyone! I tried to make a call to the state of a contract developed on truffle, using web3.js in React, the problem is this, when I try to see the price of

Emit data from stencil component to ReactJs component

How to catch emitted data in stencilJs component in ReactJs component? I've created a CustomInputStencil component that has a prop of onChange that accepts a fu

Edit Product with images using React-Dropzone

When creating a product I use React-Dropzone but when editing I intend to use it in the same way. I would like that when editing the product, the images that ar

How do I adjust the position where an anchor lands?

I'm using React and Material UI for this, On my navigation bar at the top of the page I have several links that are anchor links: return ( <Box sx={{

Navigation error: Null is not an object (evaluating '_navigation$getParam.id')

I don't know why my navigation isn't working properly, it throws me the following error every time I want to navigate back to my EventAssistants screen from my

How to detect the device on React SSR App with Next.js?

on a web application I want to display two different Menu, one for the Mobile, one for the Desktop browser. I use Next.js application with server-side rendering

default value for multiple select in form antd 4

I'm unable to set default value for multi select inside form. Use Case: I have created a react component that renders a select with some default props that I n

Check if the browser tab is in focus in ReactJS

I have a website in ReactJS. I want to get a callback whenever my tab comes in focus or is hidden. I came across the Page Visibility API for this but I'm not ab

How to cancel a fetch on componentWillUnmount

I think the title says it all. The yellow warning is displayed every time I unmount a component that is still fetching. Console Warning: Can't call setStat

How to restrict user below 18 years to not register using reactjs datepicker?

I have successfully implemented the react js datepicker. Now I want to restrict users below 18 years to not register. This is my datepicker <DatePicker se

How to use a getter function inside a React component?

I am trying to make a basic React component to retrieve a value from a deployed contract. In this example, I am using an input box to receive a contract address

react native flatlist animation is not working as expected on RTL devices

I'm working in app that needs flatlist animation with RTL devices. I built a small app to understand how it will work. When using the app with LTR devices, it w

Transparent background of the images are too big

I'm trying to position three images with flexbox inside a container, but the images have a transparent background, that somehow interfere with each other. Here

Next.js, Strapi - Fetch response is empty

I have nextjs frontend that fetch data from strapi backend. Problem is that data is empty even if i can see on strapi dev logs that request has been made. This

Custom components in react-markdown

I would like to create a custom component in react-markdown. Specifically I need to be able to create a tag that will allow me to create a tooltip. E.g. [name]{

Pasting file not work from clipboard on react (updated -> about clipboard permission)

I want to impement to file upload by paste from clipboard. so, i tried that get a file object from onPaste. const handlePaste = (e) => { console.log(e.cl

eslint error 'value of props' is missing in props validation using React JS on moving the props from return section to a new function

I'm getting below eslint error after moving the props to a separate function. Here is my initial code and it is getting compiled successfully: const MessageComp