Quantcast
Channel: Redux-thunk dispatch an action and wait for re-render - Stack Overflow
Browsing latest articles
Browse All 5 View Live

Image may be NSFW.
Clik here to view.

Answer by ic3b3rg for Redux-thunk dispatch an action and wait for re-render

You can manage this with the prop and a ref. The ref will avoid the need to rerender the input (i.e. for autoFocus to work): import React, { Component } from "react"; import { render } from...

View Article



Answer by karthik for Redux-thunk dispatch an action and wait for re-render

This is an hypothetical situation and an open issue in REACT(at the same time NOT) since it is consistent with the HTML spec for autofocus...

View Article

Image may be NSFW.
Clik here to view.

Answer by Jivings for Redux-thunk dispatch an action and wait for re-render

I think the best thing to do is not rely on refs use state to manage the focus. This solution instead uses the autoFocus prop on the input, and modifies it when the state of the checkbox changes....

View Article

Image may be NSFW.
Clik here to view.

Answer by Reed Dunkle for Redux-thunk dispatch an action and wait for re-render

I think that you can have confidence that the updated Redux state data is there before you perform your focus() call, because of the data flow: Dispatch async action toggleThunk, and wait for its...

View Article

Image may be NSFW.
Clik here to view.

Redux-thunk dispatch an action and wait for re-render

import React from "react"; import { render } from "react-dom"; import { createStore, applyMiddleware } from "redux"; import { Provider, connect } from "react-redux"; import thunk from "redux-thunk";...

View Article

Browsing latest articles
Browse All 5 View Live




Latest Images