返回首页

Questions tagged [reactjs]

React (also known as React.js or ReactJS) is a JavaScript library for building user interfaces. It uses a declarative paradigm and aims to be both efficient and flexible.

Filter by
Sorted by
Tagged with
0
votes
0answers
8 views

Async nature of setState() not showing updated props from parent component

I understand that setState() is async by design in react, and I get why - because JS is single-threaded and so are browsers, therefore re-rendering is an expensive operation. I have a very (what seems ...
0
votes
1answer
5 views

Cannot read property 'map' of undefined in react/redux

before adding the map function i was getting the state after adding map function i get. I am not able to pinpoint the location of the problem.saw many posts on stackoverflow but none solved my ...
0
votes
0answers
18 views

Updating location state in the route is not reflecting on the parent components

I have a react app and I am using react-router for routing. I have created a <PrivateRoute> component which renders the component only when the user is logged in. In the app, the title in the ...
0
votes
1answer
22 views

Play video on mouseOver using JS in React

Just trying to get these videos to play on mouse over. I can see from the console I need to make a function instead of using a string (other SO answers use strings), so how can I do this without ...
1
vote
0answers
7 views

How would I apply Material-UI managed styles to non-material-ui, non-react elements?

I have an application where I'm using Material UI and its theme provider (using JSS). I'm now incorporating fullcalendar-react, which isn't really a fully fledged React library - it's just a thin ...
0
votes
3answers
39 views

Change color of TouchableOpacity in React Native

Can anyone help me. This is my source code: http://snack.expo.io/rJFgyPDpH Idea is that, if I click to "1 Button" it should be 'red' and if I click to "2 Button" is also should change its color to '...
0
votes
1answer
13 views

I am looking for a way to fix the first column in table component in react material ui

I am looking for a way to fix the first column like this web site on bottom. How can I make the first columns fixed when scrolling?
0
votes
1answer
40 views

get dynamically generated form data in array

I am adding multiple inputs by sizes array that looks like this [ { _id: "1", size: "Size 1", price: 2 }, { _id: "2", size: "Size 2", price: 4 } ] In the form like this <...
0
votes
0answers
11 views

Why is React Final Form Submit Button Not being enable and values not posting?

I have two problems with my React Final Form Component. I cannot enable the submit button one text is typed in the input field. And Once the form is submitted the values are not posting to my server. ...
0
votes
0answers
13 views

how to build a express that can satisfy both mobile and web

Maybe many of you already answered this kind of questions before and even did this. But maybe my case is a little bit different and I really want a clear and proper answer. Basically my team already ...
3
votes
0answers
21 views

Manage state of global variable react redux

How do I get the state of this? I only need to put it as false and true the time I want at my components, but i`m doing something wrong, i know how do it when calling an API, but not like this. I ...
1
vote
0answers
16 views

How to push into an array corresponding to the body i'm passing to the api?

I have a post api which accepts a body(id) and returns an array.While returning that array i'm mapping through the array and pushing the elements into a new array(that's what i want because i need ...
0
votes
1answer
13 views

create-react-app bash: /usr/local/bin/create-react-app: No such file or directory

I had an origonal problem that I tried to fix and got another problem 1. ORIGONAL PROBLEM I just tried to install a new react app using create-react-app and got this error first Please note that ...
0
votes
0answers
10 views

Creating a URL mapping for my ReactJS app running in development mode

I have been stuck with this for sometime now. I have a ReactJS app running on development mode, on port number 3000. I am trying to create a mapping with nginx so that all requests at avt1.example.com/...
0
votes
4answers
28 views

Adjacent JSX elements must be wrapped in an enclosing tag, missing parent tag

I'm trying to add an action buttons to my shedule app source code import React, { Component } from 'react'; import { Text, View, StyleSheet } from 'react-native'; import {Agenda} from 'react-...
0
votes
0answers
9 views

Initializing state, while testing a component with useState using jest & enzyme

This question is not for testing state change, but for setting initial value to true. So that menu will be opened and I can test onClick functionally on the opened menu. I am using Jest and Enzyme. ...
0
votes
0answers
10 views

How to show image in the list using reactjs?

I'm new to react, I could add image in Add Contact Component but unable to show in the contact list. I could add image through Imageview Component but unable to save the image and couldn't able to see ...
0
votes
0answers
8 views

IE11 iframe memory leak with reactjs and antd

I got memory leak problem with IE11. When I adding and remove child iframe, the memory goes up for 50M after removing the child iframe in production mode. And I found, in development mode, when I ...
0
votes
0answers
16 views

Trigger a click event on element and then unmount it

I'm trying to implement a suggestion list. I use <input/> followed by a number of <div>s. When the input element is focused, list, or divs, will show; when the input element is not focused,...
0
votes
0answers
24 views

Retrieving JSON ID of an iterated object when using Object.keys()

I am trying to use Object.keys to iterate through JSON data to populate an array of objects to use with React-Select. The JSON data is formatted thus: { "us-northeast": { "label": "...
0
votes
1answer
31 views

&nbsp; causes line break in React

I have one question about &nbsp; when I call dangerouslySetInnerHTML, &nbsp; would cause line break. If i replace them with spaces, it would work please check my codesandbox http://...
0
votes
1answer
24 views

Firebase: reading data from firestore in react

I am trying to follow this tutorial. I had this working before I tried to reconfigure my firebase.js config so that I could include authentication in the app. I am trying to read from a collection ...
0
votes
1answer
24 views

How can i display API response data in a table

I have the following code to fetch data from API using axios in reactJs import React, { Component } from 'react'; import axios from 'axios'; export default class App extends Component { ...
0
votes
1answer
14 views

How to override default style with ReactJSS?

I've implemented a table in my component: <table className={classes.vehicleStatusTable}> <thead> <tr> <th>MILEAGE</th> <th>TREAD <...
0
votes
1answer
15 views

How to handle routing logic to prevent infinite loop in componentDidUpdate?

I'm creating a header with multiple options and specific options will have class 'active' depending on the url pathname (e.g. 'plant/tree'). To do this I've set up component HeaderOptions and in state ...
0
votes
1answer
13 views

How do i loop React bootstrap carousel items

Below is my code, I would like to put inside a for loop and based on my item count i would like to create carousel items. This can be easily achieved in angular by using ngFor but i don't know how to ...
0
votes
1answer
25 views

How to make TypeScript enum restrict to specific number [duplicate]

I use a enum number type to set a page's access code: export enum AdminAccess { None = 0, Dashboard = 1 << 0, ModifyUserInfo = 1 << 1, Publish = 1 << 2 } And I want the ...
0
votes
1answer
40 views

How To concat an Object and Array in Javascript?

I have a user with a favorites array I am trying to concat an item to the favorites field. Here I assign the user to userToChange variable const userToChange = action.data.user; And here I concat ...
0
votes
2answers
15 views

ReactJS not displaying Django REST Framework API data

I am trying to use ReactJS to build a simple website that pulls data from my Django REST Framework API. The issue I am running into, is that my data is not being output by React. I am certain that my ...
1
vote
0answers
11 views

Owl Carousel 2 does not work when using event.preventDefault()

so i'm trying to learn react ... i have a header with a navbar and if you click on any item of the navbar a function will be executed ... this is the function : clickHandler = (event) => { ...
0
votes
2answers
34 views

regex is failing for version numbers

i have used below regex for allowing me to enter alphabet, number, special character and should not allow trailing and leading space for the entire word Not allowed patterns : (space)text(space), ...
0
votes
1answer
25 views

Issues implementing a search function “TypeError: data.filter is not a function”

EDIT: heres the console.log(data) the data is displaying fine, it's just not filtering the data properly..] !http://imgur.com/a/SsEDAKj! EDIT 2: this.state.items is an array. I'm trying to ...
0
votes
0answers
40 views

Async/await function is not working as expected

I'm new to using async/await and from my understanding, I can declare the function as an asynchronous function and then use await inside of that function. What I would like for my code to do is to ...
-1
votes
1answer
32 views

How do i change state of an array of objects in react js

I'm trying to make a change to my state in react, and my state is This.state = { Name: "alex", Referrals: [ { Id: 1, HasRegistered: false, friend: { Name: "john", Age: ...
0
votes
0answers
14 views

How to create scroll snap like in tesla.com and some more questions on parallax

I'm working on making a simple react template that will have parallax, smooth scroll, and snap scrolling combined. It is in the very early stages. http://codesandbox.io/s/parallax-with-smooth-and-...
1
vote
0answers
13 views

react js redux with materialize.ui

Hello I have a problem using a style in my components in materialize: Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of ...
0
votes
1answer
35 views

Is this a controlled or uncontrolled React component?

I read the answers on this question but none is similar to my set up: What are controlled components and uncontrolled components? I have a parent component and many children as inputs. Each input ...
0
votes
1answer
18 views

Set initial region after getting current location isn't working

I am using functional component with Hooks and I am getting user current location and assign it to MapView initialRegion but component doesn't rerender. I tried to use reference ref with MapView ...
0
votes
0answers
17 views

React, saving mouse coords in state causes window to scroll to the top, how to solve?

I'm using Handsontable for my grid in an application. When a user clicks on the grid, I want to save the mouse coordinates in state, which I use later to properly position a modal window. The grid ...
0
votes
1answer
14 views

React - how to map buttons in a list to the object they are in?

I have the following class Component which reads data from localstorage. The Localstorage has an array of objects. Those objects are rendered in a list as you can see below. In each list item there is ...
0
votes
0answers
8 views

Can you send keyboard events to a react component with only it's ref?

Given an input defined as: <input ref={myRef} onChange={handleChange} value={value} /> I want to have a button that can send a keyboard event to this input as if I typed the key in the input ...
0
votes
2answers
31 views

How to pass props to one React Class to Another React Class?

I am trying to have a button enabled in a modal when text is entered in an input field. But my form is built in another class and is used in a parent class. How can I pass an onChange method my form ...
0
votes
0answers
16 views

React: How to check X is selected or not

I'm trying to develop React Component changed if it is selected. So I set up isSelected for checking if the item is selected or not like below: src/components/common/Youtube.js const Youtube = ({ ...
1
vote
0answers
19 views

Redirect page react auto based on condition

Currently I am trying to redirect the user based on a conditional statement. So if the number is dividable by 10 the user will be redirected to winner page, else to lose page....no click need (if ...
-1
votes
1answer
16 views

How to send a formData to mysql with python and react?

I want to save a image in react in a formData and send to python using flask for save it in mysql but i don't know if that is posible or what´s the type of variable that i have to use in mysql that´...
0
votes
0answers
20 views

How to make a graduation for displaying the time of the events?

how would like to know how to do something like this gantt ? I tried many thing since few hours but i cant find the right solution. let me explain, i have many progressBar created with ReactJs, and i ...
0
votes
1answer
26 views

Best way to handle loading of many components with API requests in React?

I'm currently building an SPA in React that fetches around 1000 items of data from some API and shows it in a large list on the main page of the application. The API has a single end point to fetch ...
0
votes
0answers
4 views

How to ensure the page refreshes when on screen using React Scroll for React JS

I am using React Scroll to scroll to various components within my app. I am using 'gsap' for animations and would like to know if it's possible to have the page refresh (for desired component) every ...
0
votes
1answer
39 views

Javascript variables in class methods are not persisting

I am generating inputs on a form in a React class. The inputs will write to a deeply nested JSON object. As I generate each input, I pass the series of keys as an array to help the input determine ...
1
vote
1answer
42 views

useEffect local state behavior after it get updated

In this reactjs doc example about hooks import React, { useState, useEffect } from 'react'; function useFriendStatus(friendID) { const [isOnline, setIsOnline] = useState(null); useEffect(() =&...

返回首页
杏彩计划 杏彩官网 杏彩APP 杏彩走势图 杏彩下载 杏彩官方 杏彩网站 杏彩怎么玩 杏彩官方 杏彩靠谱吗 杏彩代理 杏彩骗局 杏彩投注 杏彩倍率 杏彩开奖 杏彩漏洞