Skip to content

Commit 994a010

Browse files
authored
Merge pull request #4167 from shu1513/patch-26
Update part2e.md
2 parents 71fc151 + 20d425e commit 994a010

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/content/2/en/part2e.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,19 @@ const Notification = ({ message }) => {
124124
</div>
125125
)
126126
}
127+
export default Notification
127128
```
128129

129130
If the value of the <em>message</em> prop is <em>null</em>, then nothing is rendered to the screen, and in other cases, the message gets rendered inside of a div element.
130131

131132
Let's add a new piece of state called <i>errorMessage</i> to the <i>App</i> component. Let's initialize it with some error message so that we can immediately test our component:
132133

133134
```js
135+
import { useState, useEffect } from 'react'
136+
import Note from './components/Note'
137+
import noteService from './services/notes'
138+
import Notification from './components/Notification' // highlight-line
139+
134140
const App = () => {
135141
const [notes, setNotes] = useState([])
136142
const [newNote, setNewNote] = useState('')

0 commit comments

Comments
 (0)