Skip to content

Commit b08cf38

Browse files
authored
Fix type error in Redux Essentials (#3814)
1 parent 380e8b0 commit b08cf38

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/tutorials/essentials/part-3-data-flow.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ We'll import `createSlice`, define our initial posts array, pass that to `create
121121
import { createSlice } from '@reduxjs/toolkit'
122122

123123
const initialState = [
124-
{ id: 1, title: 'First Post!', content: 'Hello!' },
125-
{ id: 2, title: 'Second Post', content: 'More text' }
124+
{ id: '1', title: 'First Post!', content: 'Hello!' },
125+
{ id: '2', title: 'Second Post', content: 'More text' }
126126
]
127127

128128
const postsSlice = createSlice({

docs/tutorials/essentials/part-4-using-data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export const SinglePostPage = ({ match }) => {
5555
const { postId } = match.params
5656

5757
const post = useSelector(state =>
58-
state.posts.find(post => post.id.toString() === postId)
58+
state.posts.find(post => post.id === postId)
5959
)
6060

6161
if (!post) {

0 commit comments

Comments
 (0)