Questions tagged [react-memo]
65 questions
0
votes
4 answers
React.memo issue with Redux
I have two components.
function Parent(props){
const handleClick = () => {
console.log(props.stateA);
};
return
}
const mapStateToProps = (state) => {
return {
stateA:…

Tom
- 770
- 9
- 18
0
votes
3 answers
Prevent Re-rendering inside a map React
I'm trying to make a clone of netflix, when I have the mouse over a image of the movies the trailer of that movie appears, there appears the problem when i mouseover i have many same outputs in the console. I think this problem is because im…

Sebas
- 27
- 6
0
votes
1 answer
React.memo and invalidation in Functional component not invalidating
I have a React functional component wrapped with React.memo as follows
const SpeakerDetail = React.memo(
({ record, prop1 }) => {...
When I call this component, I do it like this
const record = {prop1: 'abcd', prop2: 'efgh', prop3: 'ijkl'};
const…

Pete
- 3,111
- 6
- 20
- 43
0
votes
3 answers
I use React hooks and React memo to prevent my functional component from re-rendering ,but not work?
I use React.memo to control re-render, but my component still re-rendered.
my code like this:
in my Template Component:
const Template = (props: Props) => {
const { propsValue, data } = props
const [value, setValue] = useState(propsValue)
…

serenas
- 137
- 4
- 10
-2
votes
1 answer
How do you properly use React.memo w/ event handler props from HOC?
I've created a very simple example here..
https://codesandbox.io/s/react-memo-with-function-props-09fgyo
As you can see, ComponentB renders just as many times as ComponentB.. even though it's wrapped in memo and isn't receiving counter as a prop.
If…

RavenHursT
- 2,336
- 1
- 25
- 46