2020欧冠比赛时间

Questions tagged [reactjs]

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

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

How do I trigger an action after API call using redux-api-middleware

I am trying to use redux-api-middleware. I would like my app to POST a sign up request to an API and once it receives a response, trigger a function, similar to a .then() function. Something like this:...
0
votes
0answers
6 views

Reduce Loading Time of 0.chunk.js in React App

I am creating a react app. There is a js file 0.chunk.js having size around 1.5 MB, and it takes over 30s to load which delayed my app to load. I want to know how can i reduce the loading time?
0
votes
0answers
7 views

Material UI modifier class styles using props not working

Trying to set the colors based on props for an inner selector ('&$selected' and '&:hover'). But the colors are not applied, though I can see the class related to selected being applied. const ...
0
votes
1answer
24 views

Redux - How to get data from store and post it

Newbie to Redux here, I have tried to follow a couple tutorials and I am not clear of how Redux actually works. It was mentioned that the store of Redux is to store the state of the whole tree. I have ...
0
votes
2answers
23 views

Keep everything in sync

I have a list of users coming from the database const [users, setUsers] = useState([]); database.getUsers.then(users => setUsers(users)) I print that in a simple list and when I click on each of ...
0
votes
1answer
24 views

How does App connect to multiple components and multi-level components?

I have seen a code sample, inside of the file App.js, setting up ComponentA: let connectedComponent = connect( mapStateToProps, mapDispatchToProps )(ComponentA); export default ...
0
votes
1answer
16 views

Unknown service worker is being registered

I am using the built in service worker found in create-react-app. I have registered it in index.tsx with serviceWorker.register();. If I create a production build and run it, or run it on heroku ...
0
votes
0answers
30 views

How to make two different divs to be on the same horizontal line(flex)

I'm trying to make a scoreboard in react.The scoreboard consists of a column flex which shows the different category and then 4 rows which show 4 houses and under each house there are scores ...
0
votes
1answer
20 views

Import entire directory of images into array - React

Im new to react I created my react project using create-react-app. I need the same functionality as import logo from './logo.png';but for a directory. something like import * as Images from './...
-2
votes
2answers
37 views

How to get input values and set it to state on click and console log it for react

I am trying to get the user inputs on click and set it to the state to try and display it on console but every time the button is clicked, the state properties are just empty. For example. This is ...
0
votes
0answers
16 views

Xterm.js: How to hide xterm-helper-textarea?

I try to use Xtermjs in Reactjs. but when I follow the guide. the result shows as following: It should show without top textarea and text 'W'. My codes is as following: import React from 'react'; ...
0
votes
3answers
34 views

In a Redux reducer, if state is not defined, can you immediately return the initial state?

I have seen 3 forms of reducers: // Form 1 function reducer(state, action) { if (state === undefined) return state = []; // handle action.type // ... } // Form 2 function reducer(state, ...
0
votes
1answer
22 views

ReactJs - How to map() a Map<string, boolean>

Simple question I think, but cannot find a way to make it work.. I have this Map: public optionsCheckboxes: Map<string, boolean>; And in my render() function I would like to iterate over it: ...
-1
votes
0answers
10 views

(three.js + react) Simple loading indicator for 3d model causes the canvas container to be null: TypeError: Cannot read property 'clientWidth' of null

I have a react class component that loads in a 3d model onto canvas. So far everything works, the model successfully loads in and displays on the page as <canvas />. However, I would like to ...
0
votes
1answer
8 views

npm ERR! Refusing to delete when Install react-native

I Have a Problem about NPM, I want to instal npm react-native with command npm install -g react-native-cli on cmd, But, an error suddenly appeared like this : npm ERR! path C:\Users\Xeon\AppData\...

15 30 50 per page