Use React.memo for Switch
This commit is contained in:
parent
a5ddf5c94d
commit
dd7cb0406b
|
@ -1,8 +1,9 @@
|
||||||
|
import React from 'react'
|
||||||
import {Platform, Pressable} from 'react-native'
|
import {Platform, Pressable} from 'react-native'
|
||||||
import {Switch as PaperSwitch, Text, useTheme} from 'react-native-paper'
|
import {Switch as PaperSwitch, Text, useTheme} from 'react-native-paper'
|
||||||
import {MARGIN} from './constants'
|
import {MARGIN} from './constants'
|
||||||
|
|
||||||
export default function Switch({
|
function Switch({
|
||||||
value,
|
value,
|
||||||
onChange,
|
onChange,
|
||||||
children,
|
children,
|
||||||
|
@ -33,3 +34,5 @@ export default function Switch({
|
||||||
</Pressable>
|
</Pressable>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default React.memo(Switch)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user