简体   繁体   中英

How to clear input value in Redux store?

When I press 'Enter' my function do somethin and then I have to clear input's value.. How to make it?

Getting value from Redux store using this case:

        case SEARCH_CITY: {
            return {
                ...state,
                cityValue: action.value
            }
        }

When you want to clear the input value, since you are getting the value from the redux store, you just have to call your redux action with an empty string from your function that gets called when you press enter.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM