it’s going to be tempting to type
data
asany
, which nerfs typing and precipitates much crying amongst kittens galaxywide.
The object being built has a well defined structure, and is built up based on various conditions (i.e. action sheet choices), so data: any
is not a concern; however, mutable state is, and that’s what you’re forced into due to current ActionSheet design depending entirely on side effecting handler: () => void
button prop.
If data
prop were exposed for each buttons
element, then one could thread through object state without having to maintain a class level mutable instance, and all the brittleness that that entails.
Perhaps breaking state management for this piece into a service might make sense, but it’s mutable state regardless; handler: () => void
is the culprit.