Last active
March 2, 2026 11:15
-
-
Save aleksnick/494f66e2851bc5483e50b029444d3c82 to your computer and use it in GitHub Desktop.
About hooks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import { useSelector } from 'react-redux'; | |
| import { customExpensiveSelector } from '@utils'; | |
| export default function TestComponent({ obj }) { | |
| if (!obj.someField) { | |
| return null; | |
| } | |
| const value = useSelector(customExpensiveSelector(obj.someField)); | |
| return ( | |
| <div>{value}</div>; | |
| ); | |
| } |
Author
aleksnick
commented
Mar 2, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment