When using a Composable inside an Activity (without Fragments), the function checks whether the ViewModelStoreOwner is an AppCompatActivity instead of just a ComponentActivity.
When using Fragments, it checks if the current Activity is an AppCompatActivity instead of just a FragmentActivity.
If these conditions aren't met, then it skips the injected factory and tries to create the ViewModel using the default factory.