M
M
Maxim Korolsky2016-07-21 09:52:48
React
Maxim Korolsky, 2016-07-21 09:52:48

Infinite initialization in ReduxForm?

There is a dynamic form, you need to add the ability to edit it.
Added mapStateToProps. And now I have a 10 minute initialization. And the same goes for every click.
Already all fields in the component that creates the form are hung

shouldComponentUpdate(nextProps) {
  return shallowCompare(this, nextProps);
}

But the trick is that props really change, because in ReduxForm, an action hangs on each fart. And how can I track it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Korolsky, 2016-07-21
@SuperPosan

Solved the issue by calling initialization in componentWillMount

this.props.initializeForm({
            endDate: this.props.data.endDate,
            startDate: this.props.data.endDate,
            eventSubType: this.props.data.eventSubType,
            eventType : this.props.data.eventType,
            summary: this.props.data.summary,
            uuid: this.props.data.uuid,
            headline: this.props.data.headline,
            noteType: this.props.data.noteType,
            sourceUrl: this.props.data.sourceUrl
        });

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question