Questions tagged [reactjs]

React is a JavaScript library for building user interfaces. It uses a declarative paradigm and aims to be both efficient and flexible.

0
votes
0answers
2 views

How to send a State value to a component at the same level as a prop in React?

I have a structure of components like this: SeleccionadorEmpresa Chart Nombres All this componenets are inside the main App component. I want to send a state value from SeleccionadorEmpresa to ...
0
votes
0answers
10 views

Rendering into DOM for each element in object

I have a JS Object filled with objects nested within those. If you'd rather have specifics, it's a "projects" object for my portfolio, with 7 projects in it that each have a title, description, ...
0
votes
0answers
5 views

Page doesn't refresh automatically after mutation

After mutation not updating UI I'm using update funaction. ``<Mutation mutation={ADD_USER} update={(cache, { data: { addUser} }) => { const { users} = cache.readQuery({ query: ...
0
votes
0answers
8 views

How to break for loop when axios post succeeds?

I want to break for loop when axios.post succeeds. How can I do this? for (var i = 0; i < filteredCars.length; i++) { var car = filteredCars[i]; axios .post( "http://localhost:9000/...
0
votes
0answers
9 views

Floating Action Button components throwing error in React

I am very new to React JS. I want to use a FAB (Floating Action Button) material ui react component in my application. But while running the app it is throwing compile error and I am not able to ...
0
votes
0answers
4 views

OnBlur of react-final-form-listeners does not work on iOS

I am using react-final-form in which I am making a post web API call when blurred out from the input field. This works fine in Chrome/IE but when it comes to iOS, it does not trigger. I went through ...
0
votes
0answers
14 views

How to pass an additional variable into React.forwardRef

I am trying to update my application to Material UI V4 and I need to use React.forwardRef when generating the component for the button LinkItem but I have a dynamically generated List and need to pass ...
0
votes
0answers
7 views

How to convert a WSQ fingerprint in base 64 to a image format in javascript

I have a WSQ fingerprint in base 64 and I need to convert it in a image (any format) to show on my web page. Is that possible?
1
vote
1answer
13 views

How to add front end to already deployed backend project (same repo)

I currently have a Node.js project with this file structure: strava-descriptions/ ├── .DS_Store ├── .env ├── .eslintrc.js ├── .git ├── .gitignore ├── authorizeStrava.js ├── buildDescription.js ├── ...
0
votes
0answers
9 views

My website scroll up automatically after scrolling down, unless I use the scroll down button

I'm using react-scrollable-anchor, but for some reason, if I use the mouse to scroll down the page go to the top again automatically, but it won't happen if I press the button scroll down. There is ...
0
votes
1answer
9 views

Why there is no history prop in my “connected” components?

I just migrated to react-router, react-router dom v4.3.1, installed history v4.9. Earlier, all my components which were connected to the store, got router props. Now, they say that there must be a ...
1
vote
1answer
12 views

Images not loading after using 'npm run build'

I'm still pretty new to react and I have an application that I'm trying to deploy to the web. I've noticed that when I use 'npm run build' it doesn't populate my chunk.js scripts with a '.' before the ...
0
votes
0answers
4 views

React and Apollo, using local state to manage message notifications

In a React and Apollo app I am trying to use local state as a store to manage a "Message Snackbar" component that can open to show the user messages. I cannot figure out how to get the Message ...
-1
votes
0answers
14 views

Non blocking IO front end with normal rest API backend server

I am having angular as the front end, where we can use rxjs library to make non Blocking asynchronous calls to the server. But in the server side I am not having non Blocking io architecture, which ...
3
votes
2answers
43 views

React - Updating state (array of objects). Do I need to deep copy the array?

I have the following state: const[images,setImages] = useState([ {src: 'stringSRC1', selected: false}, {src: 'stringSRC2', selected: false}, {src: 'stringSRC3', selected: false} ]); I'm ...
0
votes
2answers
21 views

How to add data to POST request using Axios?

I am trying to make a POST request but am getting the following message in my chrome network tab: {error: "unsupported_grant_type",…} error: "unsupported_grant_type" error_description: "...
0
votes
0answers
4 views

How to do animation using “three-gltf-loader” npm package

I am building an application on react where I have to show a 3D model (glTF) with an animation. I am using "three-gltf-loader" npm package and I am able to load the 3D model correctly. But while ...
1
vote
3answers
43 views

Can't define arrow methods in react components

I am trying to convert all methods of my react components to arrow functions so that I don't have to bind them before hand. but whenever I shift a method to that syntax the react starts giving error. ...
0
votes
1answer
11 views

How to export a React Component without ownProps when using redux with TypeScript?

I am using typescript with react-redux . I have the following component which doesn't take any "OwnProp" from parent but takes a prop from redux state. Redux is giving me error from Parent Component ...
0
votes
0answers
7 views

Logging in in the second time

I am building a log in, just practice, so the problem is when I click Log in with the correct info, the first time it dont do nothing, it logs in the second time only. I think the problem is that the ...
0
votes
0answers
22 views

how to run the project with nodejs,expressjs and mongo

Install the certain packages npm install npm install mongoose --save npm install express --save npm install body-parser Router.js file var Express = require("express"); var Routes ...
0
votes
0answers
6 views

How to apply routes on my link to render the right layout and component

As a schoolproject we were given a mern template. I've been stuck for a while now on how to apply the routing. I want to load the component according to the link in my navigation Please have a look ...
1
vote
1answer
19 views

how to set an useEffect to fetch data from API at first render with eslint-react-hooks?

I need to call two functions to fetch data only on the first render. I'm using react-hooks on this project. So the code would look something like this: const Component = (props) => { // init ...
0
votes
0answers
12 views

Re-using JSS in multiple components

I'm trying to reuse JSS using Material UI with React. I'm not sure if this is the right way to do it but I'm creating a global JSS style sheet called SharedStyles.js and then I'm going to export this ...
0
votes
0answers
12 views

d3.select works on body, but not on id. What am I missing?

I'm trying to make a simple line chart with d3.js, React and PatternFly 4. I have made other graphs who works as intented with the select id, but this one refuses to work and I can't put my finger on ...
-2
votes
0answers
9 views

How to deploy Next js build on apache

I am new in next.js and try to deploy build on local host according to official link is here we need a port for run build. Now question is how can i run this app on apache without port
2
votes
1answer
31 views

Font-Awesome icon does not show in my ReactJS website

I'm trying to use a font next to my website's header in a react project I`m working on but it does not show. I have imported the font-awesome package via yarn and imported the css of it in my index....
0
votes
0answers
18 views

React: I have a component that renders user data and I want to display an error message underneath the section if there's an error rendering the data

I have a section component that fetches user data and then displays that data under 3 separate headers. I want to add a separate render if the data fetch fails that would display a single error ...
0
votes
1answer
38 views

JSON values to get with .map using in React.Js

I am getting this JSON from the bachend with Loopback/Node.Js JSON1: JSON2: I am getting the JSON with this so the result is like this JSON in chrome: What I wanted to do is to map and show the ...
0
votes
1answer
22 views

React Apollo - Child not updating based on result change

I am using React Apollo to work with a GaphQL backend. The function I am creating allows users to edit the admin permissions of another user. I have two components. One component contains the React ...
0
votes
0answers
21 views

docker stuck at npm install

hi i have a project that i want to dockerize it. i run npm install and npm build with no problem on my computer but it has some problem in when i want to docker it. docker output: Sending build ...
0
votes
0answers
7 views

Cannot close a fabric panel with react correctly

When I click on close on the fabric ui panel, the screen in the background remains grey , so it seems that it is still open tried to change the onDissmed within the object, nothing seems to work. &...
0
votes
0answers
20 views

Dynamic form field is render with previous value in react

I am trying to create dynamic options using redux-form, What i have done so far is ,i have created a object as an array of objects in state named as options, now i am able to create and delete ...
0
votes
0answers
10 views

React Firebase authentication - not working properly

I'm working with react-redux-firebase. Working on change password, for some reason that is not working properly. On password update everything working fine, able to see the popup, but on authError is ...
1
vote
1answer
23 views

Node-Schedule Triggering Issue

I am creating a function on my server which is supposed to trigger daily, but not only does it not trigger as expected it triggers every time the server is reset (which it did not do yesterday). The ...
0
votes
1answer
13 views

Is it possible to create a infinite scroll inside of a Semantic Form.Select

I'm working on a project where as form.select is used and I want to be able to pull more data when at the bottom of the list. Is there a way to do this? If so could you point me in the right direction....
0
votes
2answers
21 views

How to control a Link on react-router

I am trying to build a login, I verify the input and the data, the problem is that I don't know how to disable the Link when the Input is wrong. I mean I don't want the login to continue when the ...
-2
votes
0answers
31 views

componentDidMount() is not getting fired in react js

componentDidMount is not getting called.I am trying to get results from the api and rendering the component based on those results. fetchquestions() will call API and NavigateQuestions component will ...
0
votes
0answers
17 views

React Problems Nav

I'm testing new libraries, Yea React Navigator. When I add React Navigator all code does not work, and when I delete react navigator it still doesn't work. class HomeScreen extends Component{ ...
0
votes
2answers
34 views

Mimic user interactions in JavaScript applications [on hold]

I have created the same application in three different JavaScript front-end frameworks: Angular Vue React I would like to test performance of these applications, but I would also like to mimic user ...
2
votes
3answers
65 views

Disabling style of other divs when cliking new one

I am building a "music machine", but i face problem i haven't been able to solve. All the other parts of the music machine work well. Only i want that if you click on (or press corresponding key) new ...
0
votes
0answers
18 views

How do I set initial value for radio button in redux-form?

I'm using the Field-component and setting type=radio and in the component rendering the input I have set checked={props.input.value}. The group currently contains 2 radio buttons, but 1 more will soon ...
-1
votes
0answers
16 views

How can I use TypeScript, TSX, and React for the front end of my Express project?

I've been following the Getting Started guide on the Express site, only using Typescript. Hit a couple of hurdles but everything is working like in the sample code. I want to use React instead of Pug ...
0
votes
0answers
22 views

Duplicate string index signature.ts(2374)

Following is the type that I wanted to create with index signature in TypeScript. export interface LoginState { account: { [userName: string]: string; [password: ...
1
vote
1answer
28 views

access react route params in server side

i came up with this problem with ReactJS and ExpressJS: So basically user uploads some info on /info route with React & axios. then user gets route params from server side to redirect to: axios....
0
votes
1answer
26 views

Route component needs key to properly work

I have a <Route path='/user/:id' exact component={UserProfile} /> which works greatly from every url, but it doesn't if I'm already on '/user/'. Let's say you're on /user/2 and the link goes to ...
0
votes
0answers
14 views

Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'window.Modernizr.webp.valueOf')

I am having this error only on safari. Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'window.Modernizr.webp.valueOf') I can not figure out what triggers this. I ...
0
votes
0answers
5 views

React Native WebView loses cookie when placed inside a sub-component of App-component

When I place my WebView component inside my App-Component, it does not lose the cookie shared with fetch-requests. That is expected behavior and is okay. However, if I put my WebView component inside ...
0
votes
0answers
10 views

electron-webpack-react error “Module parse failed: Unexpected character '@'”

I'm using Electron, Webpack and React on this project. When I try to build the project, I end up with this error: Module parse failed: Unexpected character '@' (1:0) You may need an appropriate ...
1
vote
0answers
9 views

Getting a network error from a refetched query after a mutation lead to an ApolloError and unsubscribe the query, am i missing something?

I'm trying to implement react-apollo with apollo-link-rest, and everything seems wonderful except error handling and refetchQueries. It seems that if a query goes in error, than got unsubscribe. I ...