import React from 'react';
import { useSelector } from 'react-redux';
export const CounterComponent = () => {
const counter = useSelector((state) => state.counter)
return <div>
{counter}
</div>
}
import React from 'react'
import { useSelector } from 'react-redux'
export const CounterComponent = () => {
const counter = useSelector((state) => state.counter)
return <div>{counter}</div>
}
import React from 'react'
import { useSelector } from 'react-redux'
export const TodoListItem = (props) => {
const todo = useSelector((state) => state.todos[props.id])
return <div>{todo.text}</div>
}
export type RootState = ReturnType<typeof store.getState>;
export const selectData = (state: RootState) => state.QnASlicer.data;
const result: any = useSelector(selector: Function, equalityFn?: Function)
Copied