@@ -32,7 +32,6 @@ class RiveReactNativeView: UIView, RiveStateMachineDelegate {
3232 private var baseViewModel : RiveViewModel ?
3333 private var eventListeners : [ ( UnifiedRiveEvent ) -> Void ] = [ ]
3434 private var viewReadyContinuation : CheckedContinuation < Void , Never > ?
35- private var isFirstConfigure = true
3635 private var isViewReady = false
3736 private weak var viewSource : RiveViewSource ?
3837
@@ -51,7 +50,7 @@ class RiveReactNativeView: UIView, RiveStateMachineDelegate {
5150 return true
5251 }
5352
54- func configure( _ config: ViewConfiguration , reload: Bool = false ) {
53+ func configure( _ config: ViewConfiguration , dataBindingChanged : Bool = false , reload: Bool = false ) {
5554 if reload {
5655 cleanup ( )
5756 let model = RiveModel ( riveFile: config. riveFile)
@@ -75,7 +74,9 @@ class RiveReactNativeView: UIView, RiveStateMachineDelegate {
7574 viewReadyContinuation = nil
7675 }
7776
78- applyDataBinding ( config. bindData, refresh: false )
77+ if dataBindingChanged {
78+ applyDataBinding ( config. bindData)
79+ }
7980 }
8081
8182 func bindViewModelInstance( viewModelInstance: RiveDataBindingViewModel . Instance ) {
@@ -86,7 +87,7 @@ class RiveReactNativeView: UIView, RiveStateMachineDelegate {
8687 return baseViewModel? . riveModel? . stateMachine? . viewModelInstance
8788 }
8889
89- func applyDataBinding( _ bindData: BindData , refresh : Bool = false ) {
90+ func applyDataBinding( _ bindData: BindData ) {
9091 let stateMachine = baseViewModel? . riveModel? . stateMachine
9192 let artboard = baseViewModel? . riveModel? . artboard
9293
@@ -115,9 +116,7 @@ class RiveReactNativeView: UIView, RiveStateMachineDelegate {
115116 stateMachine? . bind ( viewModelInstance: instance)
116117 artboard? . bind ( viewModelInstance: instance)
117118 }
118- if refresh {
119- baseViewModel? . play ( )
120- }
119+ baseViewModel? . play ( )
121120 }
122121
123122 func play( ) {
0 commit comments