I have this stylesheet:
const styles = StyleSheet.create({ primary: {}, secondary: {},})
And I would like to access the keys with dynamically composed strings.
<View style={styles[props.type]}/>
This is when TS complains (but the code runs just fine as one would expect):
Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ primary: { }; secondary: { }'. No index signature with a parameter of type 'string' was found on type '...'.ts(7053)
How could I nudge TS in the right direction and make it happy?