>  Q&A  >  본문

확인 없이 useSubmit을 사용하여 작업을 강제로 트리거하는 방법은 무엇입니까?

<p><strong>react-router-dom v6</strong></p><p>get 메소드를 사용하여 작업을 제출할 때</p> <pre class="brush:php;toolbar:false;">useEffect(() => { if (!standardSelected) 반환; clearTimeout(sectionListTimeOutId); const clearTimeoutId = setTimeout(() => { console.log('>>> 제출 호출 사용'); submit({ Standard_id: StandardSelected }, { 메소드: 'get' }); }, 1000); setSectionListTimeOutId(clearTimeoutId); }, [standardSelected]);</pre> <p>작업이 "GET" 메서드 이외의 메서드에 의해서만 실행되므로 내 작업 함수가 실행되지 않습니다. </p><p><strong>useSubmit이 아무것도 확인하지 않고 작업을 실행하도록 강제하려면 어떻게 해야 하나요? </strong></p>
P粉301523298P粉301523298405일 전470

모든 응답(1)나는 대답할 것이다

  • P粉852114752

    P粉8521147522023-08-15 09:42:15

    작업을 강제로 실행하려면 "post"方法,而不是"get"

    을 사용할 수 있습니다. 으아악

    회신하다
    0
  • 취소회신하다