Category "reactjs"

Server-side rendering not working on production Next.js

I am serving my next.js on Vercel (I tried Amplify as well). Page works but components that require data from getServerSideProps() in my pages/index.tsx are not

How do you import a javascript package from a cdn/script tag in React?

I'd like to import this javascript package in React <script src="https://cdn.dwolla.com/1/dwolla.js"></script> However, there is no NPM package,

Hashrouter no slash with react-router-dom v6

I want to add a hash with no slash to my path, like: /#store/flowers/price but since I'm not using react-router-dom v5 anymore, the v6 does not let me work with

Tailwind utility classes only working in css file and not inline

I'm using electron, react (web), typescript and tailwind. Now, currently I'm facing the problem that tailwind only works in .css files but not inline. See examp

How to serve apple-app-site-association file on /apple-app-site-association page in ReactJS

I'm having a lot of trouble with serving a apple-app-site-association file in ReactJS project. I've searched a lot of GitHub issues pages (for ReactJS, Gatsby,

Reactjs setState() with a dynamic key name?

EDIT: this is a duplicate, see here I can't find any examples of using a dynamic key name when setting the state. This is what I want to do: inputChangeHandl

Why my enum type wont work in Next.js project

I getting this error "Type 'string' is not assignable to type '"left" | "right"'." Project running on Next.js Here is my type definiton export interface TwoColu

Firebase JWT token expires in 60 minutes

In Reactjs application I am working on authorization system. Everything is working fine but problem is the authorization lasts for 60 minutes only. After I need

ReactJS: setState on parent inside child component

What is the recommended pattern for doing a setState on a parent from a child component. var Todos = React.createClass({ getInitialState: function() { re

React-typescript: Object is of type 'unknown'. TS2571

I am using React-TypeScript for my project. For state management, I am using React-redux, for function handling I am using redux-saga. For gluing the redux stor

Resizing first column gives _this.widthGetters[columnName] is not a function ( devexpress/dx-react-grid-material-ui )

Resizing the first column in Grid of dx-react-grid-material-ui is resulting in a empty screen with following error _this.widthGetters[columnName] is not a func

Mapbox Popup only opens once and never again

I am creating a React Mapbox App, and I have an issue with popups. When I render the map, all the Markers show correctly on the map. Then I click on the Marker

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