返回首页
Use Stack Overflow for Teams at work to find answers in a private and secure environment. Get your first 10 users free. Sign up.

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
18 views

How to know a component's render times

As the title shows, Can i know how many times when a class component or a functional component render? Is there any chrome extension or webpack plugin?And now i just can get this by console.log just ...
0
votes
0answers
24 views

How to loop through array of arrays in reactjs

How can i loop through array of arrays in react. Currently when i try to loop through the array, I get the following error message TypeError: Cannot read property 'map' of undefined. This is how the ...
-4
votes
1answer
20 views

How to Force React Native App launch in Background?

I've developed a React Native app with Expo, but there's something I need to run in the background so I can't find what I want. Give me the right answer, thank you
0
votes
2answers
40 views

Why my modal is not showing up after click?

I am trying to add a button that would open a modal where a user could fill their information. But I have a problem. I inserted a modal from bootstrap but it is not working. The button appears but ...
2
votes
1answer
18 views

How to fix redirection problems in a react-material menu

With my menu I encounter different problem. For starters, in the first RETURN, I have a TREEITEM with a LISTITEM and a LISTITETEXT. I put an OnClick in the LISTITETEXT so that if the id of my menu ...
0
votes
0answers
15 views

React setStart changed the value of start but did not change in React Developer Tools, prompting Resta Value

React setStart changed the value of start but did not change in React Developer Tools, prompting Resta Value, await this.setState({ count: this.getBannerStatis(res3, params), params, checkData: ...
0
votes
1answer
30 views

Best practises React hooks HTTP loading

I recently started another project with react, as I had a little time to fiddle around, I used functional components with hooks. I had no problem whatsoever, there's just one thing I'm not sure I use ...
-1
votes
1answer
24 views

How to stay login after refresh the page in react js

I have a problem when i refresh the page , the page automatically return false isLogin. i dont know, i already tried many times and ask to stackoverflow but no result. as we know . the browser will ...
1
vote
1answer
20 views

React test fails on wrapper.instance()

I'm new to React unit testing and I'm trying to write a test for a component method. Taking the below example, I need to write a test for the changeHandler method of ComponentA: import React, { ...
0
votes
0answers
10 views

onBeforeUnload creates prompt even when function returns nothing

I have a page on my site to enter some values. These can be saved and modified later. I want a prompt to appear when the user attempts to leave the page, but only when there is unsaved data. I have ...
0
votes
1answer
19 views

React router render method with HOC

I'm trying to implemenent this logic inside react-router-dom (5.0.1). This is my route: <Route path="/available-days" render={props => isAdmin ? Auth(UserProfileView) : <...
0
votes
0answers
21 views

Deploying Reactjs and PHP application together on Nginx at Ubuntu 18.04

I am trying to run reactjs application and PHP application together on Nginx. Reactjs application runs well, but I am unable to run PHP application. I have added two server blocks for both the ...
0
votes
2answers
36 views

push state object into state array in reactJS application

I have a store file which contains states. I defined user like this: user: store.getState().user || { jobRecord: [] }, What I want is to push some job objects into user.jobRecord. The job object is ...
0
votes
1answer
19 views

How to assign two fields data in header of react-csv

I am working on react-csv. I created an array for custom headers there I used header array and assign label and key. Currently, I have a situation of two fields to be assigned ( in the header, key is ...
0
votes
0answers
14 views

How to handle 404 in Reactjs dynamic pages based on Ajax response?

I have react component with Dyanmic ID. <Route path="/dashboard/tag/:id/" component={TagDetail}/> <Route path="" component={NotFound}/> In TagDetail Component I'm calling server for ...
-1
votes
0answers
14 views

How do I deal with react routing, faced an issue

I am working on a SPA project and issued a problem while trying to add React <Link to="/more">, I added an function that renders a simple <h1>More<h1> and <Route path="/more" ...
0
votes
2answers
46 views

Why should I specify a wrap element: <div> or <React.Fragment> or <> in JSX returns?

I see React raises errors when returning JSX codes for multiple elements, so it requires to always wrap those elements using these 3 options: <> <React.Fragment> <div> e.g. this ...
0
votes
1answer
25 views

how about validation if the login fails

if the condition is right then redirect to home, but if the condition is wrong don't do anything, I want if the condition is wrong it will display alerts that are filled from the response API for ...
0
votes
2answers
40 views

How to trigger the useCallback in React

I am having a React(version used 16.8) component, I have a const updateDiffText = useCallback(() callback on click of anchor GENERATE DIFF onclick onClick={updateDiffText} I call call back this ...
-1
votes
1answer
22 views

How to multiple reactjs application communicate after publishing?

I Have multiple applications in reactjs which are pubslihed. How do I create a run time communication between multiple applications after publishing?
0
votes
5answers
59 views

React - Conditional JSX Render

I wanted to ask if there is a better way to write this React Code. Essentially there are 2 buttons and one is always 'active'. The issue is this // Menu Config let menuMessages = false let ...
1
vote
2answers
36 views

React - How to trigger animation if value of div/span is updated?

I have the following problem: I'm working on a react app and I have a div, which contains multiple span-tags. The value of these span tags are dynamically changed and whenever a change of these values ...
1
vote
1answer
53 views

Only MM part of MM//DD/YYYY is assigned to variable

I am new to React and was learning how to work with React Router by using Open Weather Map API. The problem I faced is that I wanted to create dynamic routing by passing date in format of MM//DD/YYYY ...
0
votes
1answer
38 views

How to include SVG file in React?

I am making a small React based application and I am trying to include a magnifying glass icon SVG. However React keeps throwing an error and I am not sure how to proceed. Any help would be ...
0
votes
0answers
30 views

Why array does not set using useState in react [duplicate]

I'm trying to set array using useState feature function SelectCategoryList() { const [presentDataArray, setPresentDataArray] = useState([]); const hello = ['hello', 'bye']; ...
0
votes
1answer
31 views

React-select-checkboxes onClose event not working

I have an react app where I am using 'react-multiselect-checkboxes' library to display multiple checkboxes inside an dropdown. This is I have done so far. <ReactMultiSelectCheckboxes ...
0
votes
3answers
24 views

Get URL pathname in nextjs

I have a signin page and layout component.Layout component has header.I don't want to show header in signin .and for that I want to get url pathname.based on pathname show the header . import * as ...
0
votes
1answer
30 views

Converting Material-UI to a class in react

I am trying to use the 'Stepper' react material-ui component, but I am having difficulty using it in a class fashion, rather than function as they have in their previews. Here is what I have so far, ...
2
votes
3answers
34 views

Uncaught Invariant Violation: Target container is not a DOM element.- Reactjs

This code is working fine when running locally. When I upload this in 000webhost and use the path of bundle.js in WordPress page then facing this error. I am getting the above-mentioned error without ...
1
vote
6answers
60 views

Date formatting in react js

I want to display dates (range odf dates). The format of dates coming from DB seperated by hyphen is Sep 21, 2017 - Sep 29, 2017 I want to convert it to the format 09/21/2017 - 09/25/2017 ...
1
vote
3answers
28 views

How to render React Child Components from a function call?

I'm trying to call a function, rows(), in my App component, which will render PhoneBook child components: import React from 'react'; import PhoneBook from './components/PhoneBook'; const App = () =&...
0
votes
1answer
28 views

Where should i store the user data to the database or to Redis cache

I have a workflow wizard type of web application (built with ReactJS) with 5 pages, with each page having some input fields and a “Save and Next” button and the final page has “Save and Submit” ...
0
votes
2answers
23 views

Is this how you properly add a new item to the state?

I'm trying to add the oldWorkout object to the store so i can use what i push into it, but whatever I try, it doesn't add to the store, even if I start with the oldWorkout object directly in the state ...
0
votes
0answers
14 views

Lost image,css, and firesbase function in webpack build

I bumped into the issue that all image and function that connects firebase is gone after build my website with webpack. I think my webpack config is something wrong, however I couldn't figure out how ...
0
votes
0answers
17 views

React.js - Next.js: How To Render Data Server-side when using Apollo Client?

My component currently hydrates on the browser, something I'd love to avoid. When you visit the link, I want it to come pre-hydrated with all the data it needs to display, i.e. rendered on the server. ...
0
votes
2answers
25 views

How can i add a condition in a modal using bootstrap-4-react?

I need to add a condition in a modal using bootstrap-4-react, but the modal always appears without respecting the condition used. I will show what I have at this moment: import Boostrap, { Modal } ...
0
votes
1answer
30 views

Merge Two Api's from JsonPlaceholder

I'm new to coding and I am in the process of building a blog app. I am using axios to make api calls to Jsonplaceholder. I'm trying to get to map a div that renders a title, description, and name, but ...
0
votes
3answers
33 views

Having Trouble Rendering an Object Passed Down in Props

Hey Guys, this is my first post on Stack Overflow, but I will do my best to adhere to the proper formats! To sum it up, I have spent the last five hours on this react component, trying to render a ...
0
votes
2answers
31 views

how do it pass props to each component when having this kind of structure of routing

im using coreui for my project. in that i want to pass props for each component im rending in map method when needed. below is the code for mapping each component with routes render() { return ...
0
votes
1answer
19 views

React .getBoundingClientRect doesn't work

I am trying to use .getBoundingClientRect() to get the position of the current canvas in React. However it keeps returning DOMRect {x: 0, y: 0, width: 0, height: 0, top: 0, …} but my canvas is not in ...
0
votes
1answer
20 views

BlueprintJS / React - trouble retrieving TagInput > Tag value via onClick

In a React/BlueprintJS app, I have a TagInput. I need to access the string value of any Tag when clicked. For simplicity, let's assume I just need to console.log(value). I can't seem to locate the ...
0
votes
2answers
42 views

React Native - Return value from event listener in a promise

This has more to do with promises and async/await than the package I am using but in any event, the package is react-native-background-upload and I have an issue with getting back the response from ...
0
votes
1answer
30 views

How to make images fit the page in React/Bootstrap?

I am using a function that maps every item in the props array to creating an image tag. I am trying to make every 3 images have a row div around them using bootstrap so they will fit the page ...
0
votes
1answer
35 views

Using map and loop to display items

I have the following data flowers object: [ 0: {clientName: "clientA", clientAddress: "123 someOther street", flowerName: "Rose", flowerType: "0"}, 1: {clientName: "clientB", clientAddress: "...
0
votes
0answers
15 views

How to you Geolocation with react?

I'm using react and i need to create a function that's check whether a user has a location coordinates and if not - then to get them by using Geolocation api. I've created a helper.js file with the ...
2
votes
2answers
76 views

Array.map is not rendering in react native

I have some issues with my code, I don't know what is wrong, look this is my code : import React, { Component } from 'react'; import {ActivityIndicator,Alert,View, Text,ScrollView,Image,...
0
votes
0answers
12 views

Setting idle time in react-idle-timer

I'm implementing react-idle-time in my React app to log users out after a certain time of inactivity. I set the timeout time and when it's reached it hits the _onIdle() event and from there I'm able ...
1
vote
1answer
14 views

Material UI Drawer Component - Can I remove overlay it adds?

I am trying to use the Drawer component and I have noticed that when the drawer is fed the prop open={true}, there is a default dimmed overlay on the underlying page / div. Is there a best-practice ...
0
votes
0answers
12 views

Reactour and focus issues on re-render

The Scenario I am using the Reactour library to create a guided tutorial on my website. The library allows me to interact with highlighted components, which is the desired behavior. However, my input ...
0
votes
0answers
9 views

FullStory with React-Native n.getElementsByTagName is not a function

Windows 10 React-Native stack "react": "16.8.3", "react-native": "http://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz", "react-fullstory": "^1.3.0", I'm attempting to run http://www....

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