“Redux UseseLector” Kod odpowiedzi

Redux UseseLector

import React from 'react';
import { useSelector } from 'react-redux';

export const CounterComponent = () => { 
  const counter = useSelector((state) => state.counter) 
  return <div>
    {counter}
  </div>
}
Mystic Dev

używa Elector

import React from 'react'
import { useSelector } from 'react-redux'

export const CounterComponent = () => {
  const counter = useSelector((state) => state.counter)
  return <div>{counter}</div>
}
Nasty Newt

używa Elector

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>
}
Nasty Newt

Użyj Elector w Redux

import React from 'react'import { useSelector } from 'react-redux'
export const CounterComponent = () => {  const counter = useSelector((state) => state.counter)  return <div>{counter}</div>}

używa Elector

const result: any = useSelector(selector: Function, equalityFn?: Function)
Copied
Cautious Coyote

Odpowiedzi podobne do “Redux UseseLector”

Pytania podobne do “Redux UseseLector”

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu