Best Practice for DOM manipulation?

My very naive understanding of the React best practices is that we shouldn’t manipulate the DOM anywhere other than the render function. The original onSubmit method was manually change the DOM value for the
URL input field. Is my assumption on best practices correct? The alternative - which is in this pull request - seems quite verbose. Is it the “correct” way?