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 03394d4 commit 36efd76Copy full SHA for 36efd76
src/PhraseForm.js
@@ -0,0 +1,31 @@
1
+import React from 'react'
2
+import {useRef} from 'react'
3
+
4
+const PhraseForm = ({phrase, context, onSavePhrase}) => {
5
+ const meaning = useRef()
6
7
+ const handleSubmit = (e) => {
8
+ e.preventDefault()
9
+ console.log(meaning.current.value);
10
+ onSavePhrase(phrase, context, meaning.current.value)
11
+ }
12
+ return (
13
+ <form onSubmit={handleSubmit}>
14
+ <label>
15
+ Phrase: {phrase}
16
+ </label>
17
+ <br/>
18
19
+ Context: {context}
20
21
22
23
+ Meaning:
24
+ <input type="textarea" name="meaning" ref={meaning}/>
25
26
+ <input type="submit" value="Submit" />
27
+ </form>
28
+ )
29
+}
30
31
+export default PhraseForm
0 commit comments