Category "reactjs"

How to use react-toastify promise in axios

// how can I use the promise of toastify like I want to show spinner while fetching data then message success or failed // but I am getting error in bellow code

Can't resolve module (not found) in React.js

I can't believe that I'm asking an obvious question, but I still get the error in console log. Console says that it can't find the module in the directory, but

How to add styles to react-pdf Document

I tried with this code and cannot adjust the width <Document style={{width:"100px"}}

How to set focus on an input field after rendering?

What's the react way of setting focus on a particular text field after the component is rendered? Documentation seems to suggest using refs, e.g: Set ref="nam

React form onChange->setState one step behind

I encountered this problem building a webapp and I replicated it in this jsfiddle. Essentially, I would like an input to call this.setState({message: input_val}

Javascript file upload e.target == null when choosing another file after initially chose one

I've currently implemented the file uploading using <input> and for some reason when I try to change the file after already chosen the file. The website w

Matched leaf route at location "/cadastro" does not have an element. This means it will render an <Outlet /> with a null value by default resulting

I've been trying to solve this for a few hours now, everything I do returns this same error. Matched leaf route at location "/cadastro" does not have an element

Dynamically changing number of columns in React Native Flat List

I have a FlatList where I want to change the number of columns based on orientation. However, I get the red screen when I do this. As per the red screen error m

Axios: chaining multiple API requests

I need to chain a few API requests from the Google Maps API, and I'm trying to do it with Axios. Here is the first request, which is in componentWillMount() a

Rollup & React- How to separate component bundles?

I currently am trying to build a UI Library for React and I am having a little bit of trouble. Currently I am using typescript and rollup, and I am able to bund

React Native InitialRouteName

I'm using React Native v5.0 and trying to set a nested navigation for my app, however, the prop "initialRouteName" don't seem to work, even if i set it alone wi

Spring Security with React.js front end on other port

I'm trying to create a spring security authorization for my university project. Unfortunately, I came across a problem, my frontend is on port 3000 and the back

React Admin: I'd like to route to <Show> view from a list

I'm currently using react admin.I would like to route to my ActivityShow component when I click a row in the Resource list. When I click the row, the app route

how to integrate jenkins with react jest testing results

My project is using reatJS, jest is used to do unit test and also to generate the coverage report. Now I need to use jenkins to automatically build the project

Inline CSS styles in React: how to implement media queries?

I quite like the inline CSS pattern (video) in React and i am thinking about using it. However i have a question similar to this one. How does one go about imp

react.js antd carousel with arrows

I am looking at using the antd Caroseul, but I've not seen an example that creates a prev/next or pause button. const { Carousel } = antd; ReactDOM.render(

Displaying a Success Message on form submission with react-hook-form using hooks

I have a form that does the error validation correctly but having trouble trying to show a success message if everything is filled out and submits. I'm using th

I'm getting item.map is not a function when I try to delete an item with filter

I'm having a difficult time knowing why when I try to delete an item, it gives me a items.map() is not a function. Before I added the delete functionality, it w

Rendering <Context> directly is not supported and will be removed in a future major release error

i am getting the following errror: Warning: Rendering directly is not supported and will be removed in a future major release. Did you mean to render <Cont

TypeError: (0 , _react.useEffect) is not a function

when in the development environment, my app works just fine. When in the production environment it crashes with the error: Uncaught TypeError: (0 , _react.useE