question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Change field values of a dynamically named form using the reducer plugin

See original GitHub issue

I would like to clear the values of dynamically named forms using the reducer plugin. Is there a good way to do this? It seems that with the current API you need to know your form name in order to make changes because the plugin expects an object with keys being form names. Ideally, it would be something like this:

export default formReducer.plugin((state, { type, payload: {formName}}) => {
    switch (type) {
        case CLEAR_FORM: {
            const newState = { ...state }
            newState[formName].values = undefined
            return newState
        }
        default:
            return state
    }
`})`

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
alex-shamshurincommented, Feb 13, 2018

Please reopen the issue, it’s very important.

1reaction
gustavohenkecommented, Dec 6, 2017

Because this issue saw almost no activity for a few months, I’m closing it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change field values of a dynamically named form using the ...
I would like to clear the values of dynamically named forms using the reducer plugin. Is there a good way to do this?...
Read more >
Using redux-form reducer.plugin() with dynamically generated ...
Is there a why I can use this with dynamically named forms. Many thanks export const formPlugin = { foo: (state = {},...
Read more >
Add and Remove Form fields dynamically with React and ...
Step 1: Create a form with inputs name and email. ... This function is used to set input field values based on an...
Read more >
How to Create Dynamic Forms in WordPress - YouTube
Stop duplicating your efforts, or making your forms unnecessarily long! With Formidable Forms, you can make dynamic forms quickly and easily ...
Read more >
Adding Contact Form 7 Hidden Fields With Dynamic Data
I recommend you use a descriptive name for the Name field so that ... Then in the Value field you can enter a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found