Avoid rerendering SegmentsSelect
[MAILPOET-2677]
This commit is contained in:
committed by
Veljko V
parent
15c34c9937
commit
2267912927
@@ -11,7 +11,8 @@ type Props = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default (props: Props) => {
|
export default (props: Props) => {
|
||||||
const { id, setValue } = props;
|
const id = props.id;
|
||||||
|
const setValue = React.useCallback(props.setValue, []);
|
||||||
const segments = useSelector('getSegments')();
|
const segments = useSelector('getSegments')();
|
||||||
React.useLayoutEffect(() => {
|
React.useLayoutEffect(() => {
|
||||||
const idSelector = `#${id}`;
|
const idSelector = `#${id}`;
|
||||||
|
Reference in New Issue
Block a user