0
  if(props.filterCriteria.timeRange){
    const start = props.filterCriteria.timeRange.start
    const end = props.filterCriteria.timeRange.end
    form.setFieldsValue({
      created: [moment(start, 'YYYY-MM-DD HH:mm:ss'), moment(end, 'YYYY-MM-DD HH:mm:ss')]
    })
  }

Add this to the function component and report an error: Warning: Cannot update during an existing state transition (such as within render). Render methods should be a pure function of props and state.

Toto
  • 86,179
  • 61
  • 85
  • 118
david
  • 1
  • 1

1 Answers1

2

Call the setFieldsValue from within useEffect.

ZiggidyCreative
  • 335
  • 3
  • 14