@@ -5,6 +5,7 @@ import { forwardRef } from '#/utilities/react'
55import type { VariantProps } from '#/utilities/tailwindVariants'
66import { tv } from '#/utilities/tailwindVariants'
77import * as React from 'react'
8+ import { memo } from 'react'
89import { TEXT_STYLE } from '../../Text'
910
1011/** Props for a {@link SelectorOption}. */
@@ -95,41 +96,43 @@ export const SELECTOR_OPTION_STYLES = tv({
9596 } ,
9697} )
9798
98- export const SelectorOption = forwardRef ( function SelectorOption (
99- props : SelectorOptionProps ,
100- ref : React . ForwardedRef < HTMLLabelElement > ,
101- ) {
102- const {
103- label,
104- value,
105- size,
106- rounded,
107- variant,
108- className,
109- variants = SELECTOR_OPTION_STYLES ,
110- ...radioProps
111- } = props
99+ export const SelectorOption = memo (
100+ forwardRef ( function SelectorOption (
101+ props : SelectorOptionProps ,
102+ ref : React . ForwardedRef < HTMLLabelElement > ,
103+ ) {
104+ const {
105+ label,
106+ value,
107+ size,
108+ rounded,
109+ variant,
110+ className,
111+ variants = SELECTOR_OPTION_STYLES ,
112+ ...radioProps
113+ } = props
112114
113- const styles = variants ( { size, rounded, variant } )
115+ const styles = variants ( { size, rounded, variant } )
114116
115- return (
116- < AnimatedBackground . Item
117- value = { value }
118- className = { styles . base ( ) }
119- animationClassName = { styles . animation ( ) }
120- >
121- < Radio
122- ref = { ref }
123- { ...radioProps }
117+ return (
118+ < AnimatedBackground . Item
124119 value = { value }
125- className = { ( renderProps ) =>
126- styles . radio ( {
127- className : typeof className === 'function' ? className ( renderProps ) : className ,
128- } )
129- }
120+ className = { styles . base ( ) }
121+ animationClassName = { styles . animation ( ) }
130122 >
131- { label }
132- </ Radio >
133- </ AnimatedBackground . Item >
134- )
135- } )
123+ < Radio
124+ ref = { ref }
125+ { ...radioProps }
126+ value = { value }
127+ className = { ( renderProps ) =>
128+ styles . radio ( {
129+ className : typeof className === 'function' ? className ( renderProps ) : className ,
130+ } )
131+ }
132+ >
133+ { label }
134+ </ Radio >
135+ </ AnimatedBackground . Item >
136+ )
137+ } ) ,
138+ )
0 commit comments