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
  • 89,455
  • 62
  • 89
  • 125
david
  • 1
  • 2

1 Answers1

2

Call the setFieldsValue from within useEffect.

ZiggidyCreative
  • 335
  • 3
  • 16