1111
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import {useEffect} from 'react'
|
||||
import {addTodo} from '../store/todosReducer'
|
||||
import {useSelector, useDispatch} from 'react-redux'
|
||||
function Hehe(){
|
||||
@@ -7,15 +6,17 @@ function Hehe(){
|
||||
}
|
||||
const {todos}=useSelector(state=>state.todos)
|
||||
const dispatch=useDispatch()
|
||||
useEffect(()=>{
|
||||
test1()
|
||||
},[])
|
||||
console.log(todos)
|
||||
return (
|
||||
<div>
|
||||
<h1>page1</h1>
|
||||
<button onClick={test1}>TodosReducer</button>
|
||||
|
||||
{
|
||||
todos.map((todo,index)=>{
|
||||
return (
|
||||
<li key={todo.id}>{todo.text}</li>
|
||||
)
|
||||
})
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user