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