365体育足球滚球比分

Questions tagged [reactjs]

365体育足球滚球比分 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
5 views

Responsive and split layout

I started a project with react-splitter-layout and material ui library. Here the code sample : https://codesandbox.io/s/material-demo-i04rr?file=/demo.js (recommended to open the rendering in a new ...
0
votes
0answers
3 views

Monaco editor and typescript: Cannot redeclare block-scoped variable when using multiple editors

Hi, I'm using monaco-editor and monaco-editor-webpack-plugin in my React project, and I need several instances of the editor alongside each other. But when I open another editor, it seems to share ...
0
votes
0answers
8 views

React question. How to change the interval value in setInterval dynamically

I have the following code that sets the interval at which another function (a 1 minute timer) is executed. I'd like to be able to change this interval elsewhere to control play, pause and reset ...
0
votes
0answers
8 views

Uncaught TypeError: store.getState is not a function nextjs app

I am using nextjs, react js app, on creating redux store facing Uncaught TypeError: store.getState is not a function nextjs app . can some one help on this issue . i am removing provider , app is ...
0
votes
0answers
10 views

Caching asynchronous data

I recently found two libraries that perform this task https://github.com/tannerlinsley/react-query https://github.com/vercel/swr But they use a different approach that does not require stores, is ...
0
votes
2answers
19 views

React Components (return)

I'm trying to check a simple login function in react/redux. But when I try to return something from handleSubmit() , its not returning anything. (I checked if the condition is getting satisfied in ...
0
votes
0answers
4 views

Assigning an error message in Formik validation in TypeScript not working

At this moment I'm trying to build a user input form where a user is supposed to enter a name, email and password, using Formik in React & TypeScript. Handling inputs itself is working fine, and ...
0
votes
0answers
6 views

React material-table: Color rows in data-tree

I am using material-table in my React project. I have 3 levels of the data tree. Here it is the first one: Is it possible when I click the first of the 2 items on 1st Level in data tree table to ...
0
votes
0answers
6 views

How to set “build” command in package.json script using yarn

I'm trying to deploy my react app to the server using a docker image, and I'm missing the "build" command in the package.json file. My question is how to create this command and what it ...
0
votes
0answers
10 views

React app with express server shows just blanc page

I have one page react app without routing. It works fine. Now I'm trying to host it on heroku, that's why I addded express server. I run server with 'node server/server.js', and after that i was ...
0
votes
0answers
3 views

GatsbyJS & Netlify forms change subject

I've created a Netlify form on my GatsbyJS. The form itself works just fine. However, I am having issues changing the subject of my form. I have followed their instructions in the Netlify forms ...
0
votes
0answers
14 views

download a react component as pdf

Needed solution in Reactjs i want to download any component content as a pdf with all the css effect. need help to complete the downloadAsPdf function import React from 'react' function downloadAsPdf(...
0
votes
0answers
6 views

model-viewer: how to make a loading screen while model loads

I am trying to use Google's model-viewer web component to display a model on my website. However, the model I'm using is very large and hence takes time to render so I would like to display a loading ...
0
votes
0answers
8 views

npm install <pkg> gives “Cannot read property 'match' of undefined” but yarn add works fine

I am building a react/redux project and whenever I try to npm install a package it gives me the error Cannot read property 'match' of undefined However, packages add just fine when I use yarn add or ...
0
votes
1answer
19 views

React hooks, trying to do pokemon app 'front_default' is not defined

I'm trying to make an pokemon mini app but i'm stuck on image data. If i'm using an random function it is working, only problem is that on every reload there are diffrent image, on differnt file i ...
0
votes
0answers
7 views

Why does jssStyles need to be removed in componentDidUpdate or useEffect when using material-ui with NextJS?

I have read the material-ui docs on SSR and looked at their example app here, and configured my _document.js and _app.tsx to be the same. However, for whatever reason my app's styling breaks when I ...
0
votes
1answer
19 views

react props are recognized and then are undefined

I have a component that receives props from another component. The thing is that when the component renders, the props are defined, but then it updates and the props become undefined. The code used to ...
0
votes
0answers
15 views

How to change the state in react native without useState?

https://snack.expo.io/@miralis/eager-cashew Check components/high.js pls. I am trying to use "useState" here: const [number, setNumber] = useState(mid); But, when i try to add setNumber(mid)...
0
votes
1answer
15 views

Disable button on selecting specific dropdown value in React js

I have to disable button when i select a particular value in dropdown. But, it is not working on changing the dropdown value. Initially , the button is disable when the select button value is "...
0
votes
1answer
24 views

Problem using a prop in functional component IT Says TypeError: onClick is not a function

im having problems trying to use the onclick function as props it sais when i clicked TypeError: onClick is not a function What can i do! 7 | <Card 8 | onClick={() => ...
0
votes
0answers
14 views

Express. Catch All creates ugly url. Breaks react router Redirects

I'm using the catch all method with express and react-router. Express will serve the html file and react router will manage components. I have used this app.get('/*', (req, res) => { res....
0
votes
0answers
10 views

How create backend on php react js spa?

is the best practice to create backend as another project and from my react js fetch data from example.com (which is my backend) page /goods (where i connect with mysql and get from it list of goods) ...
0
votes
0answers
6 views

Forwarding refs when child component is passed by {this.props.children}

I have two React components: MainView and ChildView. When I forward refs to parent component its working: <ChildView ref={this.child} /> How to pass it with composition pattern: {this.props....
-1
votes
0answers
13 views

Error found while developing games with react

I am getting the following error while duilding tic-tac-toe game with react. "./src/index.css (./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-3-1!./node_modules/postcss-loader/src??postcss!./...
0
votes
0answers
4 views

How to handle videojs picture in picture mode in spa, react js? If I am routing through pages

I am having a route for video /video/id. If I am changing video to Picture in picture mode, and go to another page, how can I handle it? Now I am disposing videojs on componentWillUnmount. If I am not ...
0
votes
2answers
28 views

Redux: help filtering out/deleting array item of a property in my reducer

Hello So I want to give my reducer the ability to remove an item in an array of a property. I am working with a state of users that looks like this. users = { 'testUser1:{ id:'', ...
0
votes
1answer
20 views

How to execute method on constructor of the component class?

The code i have right now allows me to fetch data from database and display it on a table with a filter to show tables according to a unique id. Now i wanted to add a description column that rows is ...
0
votes
0answers
10 views

Conditional Styling use react-jss with Typescript

Incorporating JSS via react-jss in a large project. I'm wondering what the best way to handle conditional styling via props is. For reference this is what my component props look like: buttonType?: '...
0
votes
0answers
9 views

React Visual Studio Code, Debug Configuration, not breaking with red dot, had to type 'debugger'

I had this visual studio code debug configuration working where I can click and add a red break point on a React jsx file and Chrome will launch and break on that line. One day, I found that my launch....
1
vote
5answers
40 views

React Running the code Before State Change

I'm new with React and ES6,I have a component like This: import React, { useState } from 'react'; const Order = () => { let username='Test',password = 'secret'; const [Data,setData]=...
0
votes
1answer
20 views

React Router protected routes

I'm learning React Router (protected routes, to be precise) and in React Router documentation there is a function which I almost understand but there is one line of code which I can't see how it ...
0
votes
0answers
12 views

how to configure dynamic form fields inside a wizard when using a state machine

I am trying to implement a multi-step wizard using a state machine and am unsure how to handle some configurations. To illustrate this I put together an example of a wizard that helps you prepare a ...
0
votes
0answers
16 views

Intermittent Axios delete 404 error but always deleting from database

My Axios delete function below is catching a 404 error intermittently even though it is always deleting from the database. const api = "http://localhost:4000/api/message"; export const ...
0
votes
1answer
29 views

React inline Styling not applying

Hey guys I am just trying to render a set of paragraphs that contain news articles. I am using the inline styling method creating an object and assigning its value to the <h2> tag using the ...
1
vote
1answer
20 views

Props not being passed down to Material UI button text

I have a scenario in my app where I use data attributes on buttons to capture certain contextual information in the modal that is launched by pressing the button. This relies on the data attributes ...
0
votes
1answer
25 views

How to deal with nested useEffect?

Recently started using Hooks and, as cook as they are, they are giving me a bit of a headache. I have a custom useFetch() hook that deals with fetching data from the API. I also have a component where ...
0
votes
0answers
3 views

How to add a video to React Responsive Carousel Npm Package?

I am trying to create a Carousel of images and embedded Youtube videos (the first item is a youtube video and the rest are images) I am using the React Responsive Carusel npm package but I can't find ...
0
votes
0answers
20 views

Store multiple values in Redux Store using ReactJS

I want to store multiple values in redux store based on user logged in, I am using below code on my login screen : I want to store emp_id(string) and isValidCE(boolean) values to redux store. import ...
0
votes
1answer
13 views

Type error: Cannot read property offsetTop of null react. Unmounted component

I'm having a problem with a react component I made, which animates its children into view once the user has scrolled past a certain point on the page. The animation functionality works fine, but upon ...
0
votes
0answers
11 views

Screen Orientation in React or React-Native

I'm trying to use react in order to grab the screen orientation from your current window, and based on that, I would like to either to lock the orientation to landscape or alert the user view in ...
0
votes
2answers
31 views

printing out items from an array within an array of objects

I am trying to create some pills for a card display. I have an array of objects which I am mapping over to produce them on the page. Within the objects I have an array called tech which has something ...
0
votes
2answers
30 views

How can I change the color of the clicked button in React JS?

I made a simple calculator and I want to change the buttons background color when it's clicked. I want to have the code in the handleClick function, I commented the place where I want to change the ...
0
votes
0answers
18 views

\[…Array(n).keys()\] returns Array Iterator in NPM?

I'm trying to create a library and put it on NPM registry. I use create-react-library as a starter. In my code I need to create an array with range ([0, 1, 2, ... n-1]). According to this post, I did: ...
0
votes
0answers
7 views

How to reset Autocomplete in react-hook-forms?

I'm working with react-hook-forms and trying to reset all form fields after submit. The problem is that in my case Autocomplete accepts objects as a value. I've tried to set the defaultValue to {}, ...
0
votes
0answers
27 views

Print / Display a variable in Javascript

I am trying to analyze an API Connector and want to know, what a specific variable consists of. The relevant part of the code looks as follows: return this.beforeSearchCall(options, async newOptions =&...
0
votes
0answers
14 views

The best practice to set a token in the header to request a graphQL

I am working on an authentification module with a React Native Front and RoR Back with GraphQL. GraphQL gaves me a token if the email and the password are matching. Then, I want to pass this token in ...
0
votes
0answers
9 views

How to improve Webpack production build

I am using webpack to build my react app. But it takes more than 30 mins to build. Here is the webpack configuration I am using in my project. module.exports = (env) => ({ entry: './src/client.js'...
0
votes
0answers
14 views

How to handle pagination with an API call with offset in React?

First of all, I would like to say I've came across a few solutions while searching for how to make pagination but the situation is a bit different. The examples i founded consisted on making the full ...
0
votes
0answers
11 views

SCSS not reloading - React Webpack

When I makes changes to scss files, the browser does not reflect the changes unless I refresh. It was working with style-loader. However, it only works sometimes — not sure if it's an issue with the ...
0
votes
0answers
12 views

How can i solve this error: Assignment to property of function parameter ref?

I want to use a useRef to change the value from the child component: const ref = useRef(false); I am passing the ref to my childcomponent: ChildComponent( ref={ref} ) ...

15 30 50 per page
1
2 3 4 5
4568