@@ -221,7 +221,7 @@ export function useRiveColor(
221221 console . warn ( 'Rive ref is not available to set color property.' ) ;
222222 return ;
223223 }
224- ref . setColorPropertyValue ( path , newColor ) ;
224+ ref . setColor ( path , newColor ) ;
225225 } ,
226226 // eslint-disable-next-line react-hooks/exhaustive-deps
227227 [ path ]
@@ -272,16 +272,16 @@ function useRivePropertyListener<T>(
272272
273273 switch ( propertyType ) {
274274 case PropertyType . Number :
275- ref . setNumberPropertyValue ( path , newValue as number ) ;
275+ ref . setNumber ( path , newValue as number ) ;
276276 break ;
277277 case PropertyType . Boolean :
278- ref . setBooleanPropertyValue ( path , newValue as boolean ) ;
278+ ref . setBoolean ( path , newValue as boolean ) ;
279279 break ;
280280 case PropertyType . String :
281- ref . setStringPropertyValue ( path , newValue as string ) ;
281+ ref . setString ( path , newValue as string ) ;
282282 break ;
283283 case PropertyType . Enum :
284- ref . setEnumPropertyValue ( path , newValue as string ) ;
284+ ref . setEnum ( path , newValue as string ) ;
285285 break ;
286286 default :
287287 console . warn (
@@ -738,37 +738,40 @@ const RiveContainer = React.forwardRef<RiveRef, Props>(
738738 }
739739 } , [ ] ) ;
740740
741- const setBooleanPropertyValue = useCallback <
742- RiveRef [ 'setBooleanPropertyValue' ]
743- > ( ( path : string , value : boolean ) => {
744- UIManager . dispatchViewManagerCommand (
745- findNodeHandle ( riveRef . current ) ,
746- ViewManagerMethod . setBooleanPropertyValue ,
747- [ path , value ]
748- ) ;
749- } , [ ] ) ;
741+ const setBoolean = useCallback < RiveRef [ 'setBoolean' ] > (
742+ ( path : string , value : boolean ) => {
743+ UIManager . dispatchViewManagerCommand (
744+ findNodeHandle ( riveRef . current ) ,
745+ ViewManagerMethod . setBooleanPropertyValue ,
746+ [ path , value ]
747+ ) ;
748+ } ,
749+ [ ]
750+ ) ;
750751
751- const setStringPropertyValue = useCallback <
752- RiveRef [ 'setStringPropertyValue' ]
753- > ( ( path : string , value : String ) => {
754- UIManager . dispatchViewManagerCommand (
755- findNodeHandle ( riveRef . current ) ,
756- ViewManagerMethod . setStringPropertyValue ,
757- [ path , value ]
758- ) ;
759- } , [ ] ) ;
752+ const setString = useCallback < RiveRef [ 'setString' ] > (
753+ ( path : string , value : String ) => {
754+ UIManager . dispatchViewManagerCommand (
755+ findNodeHandle ( riveRef . current ) ,
756+ ViewManagerMethod . setStringPropertyValue ,
757+ [ path , value ]
758+ ) ;
759+ } ,
760+ [ ]
761+ ) ;
760762
761- const setNumberPropertyValue = useCallback <
762- RiveRef [ 'setNumberPropertyValue' ]
763- > ( ( path : string , value : number ) => {
764- UIManager . dispatchViewManagerCommand (
765- findNodeHandle ( riveRef . current ) ,
766- ViewManagerMethod . setNumberPropertyValue ,
767- [ path , value ]
768- ) ;
769- } , [ ] ) ;
763+ const setNumber = useCallback < RiveRef [ 'setNumber' ] > (
764+ ( path : string , value : number ) => {
765+ UIManager . dispatchViewManagerCommand (
766+ findNodeHandle ( riveRef . current ) ,
767+ ViewManagerMethod . setNumberPropertyValue ,
768+ [ path , value ]
769+ ) ;
770+ } ,
771+ [ ]
772+ ) ;
770773
771- const setColorPropertyValue = useCallback < RiveRef [ 'setColorPropertyValue ' ] > (
774+ const setColor = useCallback < RiveRef [ 'setColor ' ] > (
772775 ( path : string , color : RiveRGBA | string ) => {
773776 let parsedColor = typeof color === 'string' ? parseColor ( color ) : color ;
774777 UIManager . dispatchViewManagerCommand (
@@ -780,7 +783,7 @@ const RiveContainer = React.forwardRef<RiveRef, Props>(
780783 [ ]
781784 ) ;
782785
783- const setEnumPropertyValue = useCallback < RiveRef [ 'setEnumPropertyValue ' ] > (
786+ const setEnum = useCallback < RiveRef [ 'setEnum ' ] > (
784787 ( path : string , value : string ) => {
785788 UIManager . dispatchViewManagerCommand (
786789 findNodeHandle ( riveRef . current ) ,
@@ -791,16 +794,13 @@ const RiveContainer = React.forwardRef<RiveRef, Props>(
791794 [ ]
792795 ) ;
793796
794- const fireTriggerProperty = useCallback < RiveRef [ 'fireTriggerProperty' ] > (
795- ( path : string ) => {
796- UIManager . dispatchViewManagerCommand (
797- findNodeHandle ( riveRef . current ) ,
798- ViewManagerMethod . fireTriggerProperty ,
799- [ path ]
800- ) ;
801- } ,
802- [ ]
803- ) ;
797+ const trigger = useCallback < RiveRef [ 'trigger' ] > ( ( path : string ) => {
798+ UIManager . dispatchViewManagerCommand (
799+ findNodeHandle ( riveRef . current ) ,
800+ ViewManagerMethod . fireTriggerProperty ,
801+ [ path ]
802+ ) ;
803+ } , [ ] ) ;
804804
805805 const internalPropertyListener = useCallback <
806806 RiveRef [ 'internalPropertyListener' ]
@@ -833,12 +833,12 @@ const RiveContainer = React.forwardRef<RiveRef, Props>(
833833 touchEnded,
834834 setTextRunValue,
835835 setTextRunValueAtPath,
836- setBooleanPropertyValue ,
837- setStringPropertyValue ,
838- setNumberPropertyValue ,
839- setColorPropertyValue ,
840- setEnumPropertyValue ,
841- fireTriggerProperty ,
836+ setBoolean ,
837+ setString ,
838+ setNumber ,
839+ setColor ,
840+ setEnum ,
841+ trigger ,
842842 internalPropertyListener,
843843 } ) ,
844844 [
@@ -858,12 +858,12 @@ const RiveContainer = React.forwardRef<RiveRef, Props>(
858858 touchEnded ,
859859 setTextRunValue ,
860860 setTextRunValueAtPath ,
861- setBooleanPropertyValue ,
862- setStringPropertyValue ,
863- setNumberPropertyValue ,
864- setColorPropertyValue ,
865- setEnumPropertyValue ,
866- fireTriggerProperty ,
861+ setBoolean ,
862+ setString ,
863+ setNumber ,
864+ setColor ,
865+ setEnum ,
866+ trigger ,
867867 internalPropertyListener ,
868868 ]
869869 ) ;
0 commit comments