返回首页
We’re rewarding the question askers & reputations are being recalculated! Read more.

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

ReactJS: Reset-Render Child Component on Parent state change

I have a strange - at least for me :-) - issue with my Components. I have a map() function generating a list of Child elements. When I change the filter and the list repopulates the state of the ...
0
votes
0answers
2 views

Redux forms nested initialValues

Hi there i can't belive that redux-forms do not supports nested initial values. Or i do something wrong? I have reduh form in reducer and i connect in to component throw @reduxForm({ form: '...
0
votes
0answers
6 views

React MDB Datatables column is not sortable with HTML in it

I am using MD Bootstrap Data tables with my React app. I have HTML in one of my columns and I want datatable to sort based on the text with in the span. Not on the HTML in that column. Same goes for ...
0
votes
0answers
18 views

Using classnames to dynamically style component with CSS based on props value

I am creating a set of reusable components (wrapped material-ui) which are being styled using CSS. I need to set the width of the component dynamically via a prop passed into the custom button. I ...
0
votes
0answers
19 views

Static Class Variables ES6

Is it a good idea to use static properties in ES6. Some of my colleagues believe that it is a bad idea, but I did not get a good explanation as to why it was so. I am building a ReactJs application, ...
0
votes
0answers
14 views

Input loses focus even though I do everything to keep focus

I have a very interesting situation. This is my component: export const checkbox = ({ data }) => { const [data, setData] = useState({ data: [] }); const [checkBox, setCheckBox] = useState(...
0
votes
0answers
5 views

React with HTML5 Dragabble list, Change CSS for only Dragged List Item

So, I have been able to implement the draggable/sortable list for one of my projects, the only part I have stuck at is changing the style of the list that's being dragged. Is there anyone who could ...
0
votes
0answers
3 views

Error while inline editing in material-table + reactjs

I am using Material-Table along-with ReactJS to create data-table. The table properly loads and displays the data properly but once I edit the data, I get the below error in developer console Below ...
0
votes
0answers
6 views

Reactjs Centralize Components

Is there a way in ReactJS to somehow centralize every component so that when there is a new project I am working on I just need to reference to that centralize component and I will get the latest ...
-3
votes
0answers
22 views
0
votes
0answers
9 views

I am trying to edit images in react, so at first i am getting multiple images, and when i update the image state with new images, it shows error

//State for data const [editDiary, setEditDiary] = useState({}); const { editContent, editImages } = editDiary; const [ editedImage, setEditedImages ] = useState(); //Getting the data const ...
1
vote
0answers
5 views

In React Native how do you change navigation options on state change?

I have a design where the navigation header style color should change depending on the state. It is possible to change the style the first time the component is mounted. However I can't see a way of ...
0
votes
0answers
14 views

redux removes newly added state when called until rerender

I am unsure if I am doing something wrong or this is a bug with redux. I will open an issue if people think it is a bug. When I fire my addNotificationID action it adds an id along with info to ...
0
votes
0answers
6 views

Toggle between admin / user view in React

I know there are alot of questions similar to this, but Im not able to find a solution and been stuck for awhile know. So would love if someone could help me out. Im trying to get my app to toggle ...
0
votes
1answer
15 views

How to get props at the first rendering

I have a container component in which I get the ID and drop this ID into the function and the request goes, in principle, the props should come right away, but they are undefined. But when you re-...
2
votes
1answer
35 views

Nested Components not updating their state

I'm having some trouble updating nested components in my tree structure. I have created the following minimal example to illustrate the problem: Codesandbox.io For completeness sake, this is the ...
0
votes
0answers
6 views

Jest test keeps react component mounted for next test

I have 2 Jest integration tests set up, one that tests submitting a document. In the next test, the document has already been submitted so it fails when trying to submit again. The only thing that ...
-1
votes
1answer
13 views

How to add all routes(of ReactJs application) to Nodejs application on Cpanel?

I have set up Nodejs application(developed on ReactJs) in Cpanel. Everything works fine except I cannot directly browse to any route of the application. In Application Url I have the following setting ...
-1
votes
1answer
22 views

React Fetch data and save it in global state via context API

Is it a good idea to create a global state using the react context api and fetch data and save it in the context object so the child components can access the data. Or it's better to fetch data in the ...
0
votes
1answer
43 views

React: Component cannot recognize a function

In my App component I call checkUserAuth() method in order check if user is logged in or not and render different content according to this. It works fine when I call it via componentDidMount() ...
0
votes
0answers
8 views

disable max-lines-per-function on certain function **names**

I'm using ESLint's max-lines-per-function to make sure I refactor in time. My React components' render function almost always exceed my 25 lines and I was wondering, besides adding a disable comment, ...
0
votes
3answers
49 views

Passing a variable to the React useCallback hook

I'm having a difficult time learning React hooks. I'm following along on this website, http://reactjs.org/docs/hooks-reference.html const onGameOver = React.useCallback( ({ playerScore, ...
0
votes
2answers
32 views

React displaying relative time with javascript

I am creating a react app and I am trying to display the date in relative time with javascript for example "2 years ago" I created a function to convert the string to a date and figure out the ...
1
vote
1answer
18 views

React custom hook with event listener not works while updating the state

I have a custom hook that handles clicks outside of a component: const useOutsideClick = (ref, callback) => { const handleClick = e => { if (ref.current && !ref.current.contains(...
0
votes
1answer
25 views

Is it possible to set the type of input relative to the choice of a select option in React JS?

i'm writing this today because i need help. First of all, it’s not my code but an example of the Internet that fits my problem. So i need to set the type of my input relative to my select. For ...
1
vote
2answers
53 views

React alternative to ES6 classes

I have a this simple non-react ES6 class in a react-project that i use to create medication instances. export default class Medication { constructor(props) { ... } someFunction() {} } ...
1
vote
0answers
12 views

ReactJs login form that passes credentials as headers to vendor API

I have a api that I want to post automatically when a user submits the username and password. The username and password can't be hardcoded but rather any valid credentials to the api can be used. I ...
0
votes
0answers
19 views

Is it possible to target ONLY the browser back button, using popstate?

I am trying to alert the user when using the browser back button to save their changes. I am currently using the 'popstate' event listener, which works well, however once the user has confirmed the ...
0
votes
1answer
31 views

Passing the value of state using setParams and getParam to other Component

I use componentWillMount() because I think it's impossible to use static to use setParams with the state and also the GalleryScreen.navigationOptions = navData => {} outside the class of React....
0
votes
1answer
27 views

How to determine day or night based on sunrise and sunset timings of particular user location?

In Reactjs Weather project I have sunrise, sunset as well as current timing of user's current location. I want to display wheteher its day or night. How to compare the sunrise and sunset timings with ...
1
vote
1answer
15 views

ReferenceError: Can't find variable: loadMoviesLikedDetails (React Native)

I'm new to React Native and I have this project where I have a ReferenceError error, When I get into a page that display all movies the user liked, I have this : ReferenceError: ReferenceError: Can't ...
-9
votes
0answers
41 views

Can anyone help me with these questions? [on hold]

someone solve these problems. I m very new to react and couldnot solve
0
votes
1answer
26 views

eslint not linting though server is running

I downloaded a frontend template online and yarn installed all packages and an .eslint.json file does exist and the extension is installed in Visual Studio Code but it does not show any linting errors....
0
votes
0answers
29 views

What is the most elegant way to insert a letter into a box from a sequence of letters in React Native?

I'm working on a small app where the user has to guess the image by clicking on parts on image to "reveal" them. The user can choose a letter from a sequence of letters to put into a box. The ...
0
votes
0answers
13 views

Emotion (css``) does not work correctly with Next.js

My problem is as follows, in one example: I have an image that covers the entire screen, but I use {css} from" emotion " to style this and set width, ok, that seemed to work ... But wait, when I ...
-1
votes
1answer
23 views

Resizable and draggable div in react js [on hold]

I would like to create scalable and draggable div in REACT JS. More precisely, I want to emulate the windows' behavior of MS Windows in REACT JS. So, what are the best practices in 2019? I found this ...
0
votes
0answers
16 views

Errorhandling in axios doesn't seem to work on 406

I'm making a request that works on success but the catch block does not work at all. I don't see whats missing... axios.post( apiUrl, qs.stringify(this.formData()), { headers: { "content-type": ...
-1
votes
0answers
28 views

Using Django's Messages Framework with a React

I'm gradually moving the UI to React. many server notifications are implemented using django.contrib.messages. Is there a way for me to keep consuming those message in React (it's CookieStorage)
0
votes
1answer
22 views

Clear Formik form on submission not working, what am i doing wrong?

I am trying to find a way to clear this form on submit, nothing i have tried has helped. I would appreciate any insight as to what I am doing wrong! I have tried adding resets and onClick events to ...
0
votes
0answers
24 views

REACT component to list all results from a SELECT statement into a selectbox, so user can easily pick an option

I have 3 tables : Transports | Drivers | Vans. Driver_id and Van_id are foreign keys for Transports.(Each transport may have one driver and one van assigned). I am developing a creation wizard for ...
0
votes
1answer
39 views

How to make a React Hook dependent on another?

I'm new to React and working with React Hooks. I want to have react hooks for the user inputs and another array ( here the last chunk of the code) which automatically updates when User Input gets ...
0
votes
2answers
42 views

Dynamic page title with ReactJS

I want to make a Dynamic page title on ReactJS. I try a lot of things , but didn't succeed. I make an array with data: let pageTitles = [ {key:"/Home", title:"Welcome Home"}, {key:"/...
-1
votes
0answers
24 views

React asynchronous change of state and return in Function components

It is well known a state change is an asynchronous task. In Class components, state is updated on the component instance before render method is called; otherwise, it would return the same output ...
0
votes
0answers
8 views

RN - PanResponder Error calling RCTEventEmitter.receiveTouches

Im trying react native pan responder to add a circle to move it around, after I touch it I get the following error: Error calling RCTEventEmitter.receiveTouches [3,\"RCTView\",{\"left\":\"<>\",\"...
-1
votes
1answer
35 views

is it possible in React useState(<></>) has initial state is empty div or component?

my code is like that const [component, setComponent ] = useState( ? ) What will be the initial value for component if(true) setComponent(<ComponentA />) else setComponent(<ComponentB /...
0
votes
0answers
7 views

Material-UI Autocomplete & TextField triggers google autocomplete

I am trying to implement the Autocomplete component into my project but am getting the autofill/autocomplete from the browser after some time. Do you know how I can set it to off ? ...
1
vote
1answer
24 views

How to handle multiple material-UI Popovers [React.js]?

My app has multiple Popover components, I know how to handle the state of one Popover component, using something like this: class App extends Component { constructor(props) { super(props); ...
0
votes
0answers
25 views

Is there any way to make text selectable and add custom actions to context menu?

I have React Native project(with Expo). I'm trying to make my text selectable and add custom actions to context menu. After some googling I found react-native-selectable-text library which throws ...
0
votes
0answers
8 views

I can't run react-native app in android emulator Error: spawnSync gradlew.bat UNKNOWN

I'm trying to run React-Native in Android Studio emulator but when i run it this is what it says: error Failed to install the app. Make sure you have the Android development environment set up: ...
0
votes
0answers
15 views

React - adding dynamic local image on server side rendering app

Not sure why I can't do something so simple, I configured my webpack module rules with the following code: { test: /\.(jpe?g|jpg|png|gif|woff|woff2|eot|ttf|svg)(\?[a-z0-9=.]+)?$/, ...

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