You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -628,6 +649,13 @@ Once we have a reference to a view model, it can be used to create an instance.
628
649
);
629
650
```
630
651
652
+
When using a `RiveFile` source, `artboardName` and `viewModelName` are mutually exclusive:
653
+
- No params: uses the default artboard's ViewModel and creates the default instance
654
+
- `artboardName`: gets the ViewModel assigned to that artboard
655
+
- `viewModelName`: looks up a ViewModel by name across the entire file
656
+
657
+
`instanceName` can be combined with any of the above. If provided, it creates a specific named instance via `createInstanceByName()`. Otherwise, the default instance is created.
658
+
631
659
You can also get the auto-bound instance from a `RiveViewRef`:
// With onInit to set initial values synchronously
396
413
const instance =useViewModelInstance(riveFile, {
397
414
onInit: (vmi) => {
@@ -401,6 +418,13 @@ This guide documents how to get started using the Rive React Native runtime. The
401
418
});
402
419
```
403
420
421
+
When using a `RiveFile` source, `artboardName` and `viewModelName` are mutually exclusive:
422
+
- No params: uses the default artboard's ViewModel and creates the default instance
423
+
-`artboardName`: gets the ViewModel assigned to that artboard
424
+
-`viewModelName`: looks up a ViewModel by name across the entire file
425
+
426
+
`instanceName` can be combined with any of the above. If provided, it creates a specific named instance via `createInstanceByName()`. Otherwise, the default instance is created.
0 commit comments