From dd7cb0406b5887d93bf523ac766c198c4ae5c928 Mon Sep 17 00:00:00 2001 From: Brandon Presley Date: Fri, 30 Dec 2022 19:42:30 +1300 Subject: [PATCH] Use React.memo for Switch --- Switch.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Switch.tsx b/Switch.tsx index 33edb7b..83ba25e 100644 --- a/Switch.tsx +++ b/Switch.tsx @@ -1,8 +1,9 @@ +import React from 'react' import {Platform, Pressable} from 'react-native' import {Switch as PaperSwitch, Text, useTheme} from 'react-native-paper' import {MARGIN} from './constants' -export default function Switch({ +function Switch({ value, onChange, children, @@ -33,3 +34,5 @@ export default function Switch({ ) } + +export default React.memo(Switch)