Hi I'm trying to pass props to a selected fragment and I don't know how to access it correctly. Any tips?
r
Rob Murdock
06/15/2023, 2:10 PM
I’m not sure I’m familiar with the pattern you’re applying with the fragment, but if you’re looking to apply arbitrary props (props that aren’t represented by a Kotlin type extending Props), you have do something like:
though i think you’d probably be better off making real types to avoid all that
Rob Murdock
06/15/2023, 2:30 PM
if the type you’d get from that “getOrElse” has those properties enumerated, you could “unsafe cast” that Fragment to that type. As a type-safety-enjoyer I think you’d probably be better off using “getOrNull” and then use an elvis to create the fragment