We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1bcef98 commit 6323c92Copy full SHA for 6323c92
src/components/Discuss/list.jsx
@@ -1,4 +1,4 @@
1
-import React, { useState } from 'react'
+import React, { useState, useEffect } from 'react'
2
import { connect } from 'react-redux'
3
import PropTypes from 'prop-types'
4
@@ -15,6 +15,10 @@ function CommentItem(props) {
15
const { user } = item
16
const [value, setValue] = useState('')
17
18
+ useEffect(() => {
19
+ replyVisible && setValue('')
20
+ }, [replyVisible])
21
+
22
function handleChange(e) {
23
setValue(e.target.value)
24
}
0 commit comments