Hacker News new | ask | show | jobs
by ggurgone 1747 days ago
Since everything is a component in React you could abstract that eg.

const H1 = props => <Text accessibilityRole="heading" accessibilityLevel={1} {...props} />

1 comments

Sure. But I think the framework would need to emit a proper tag rather than the tag soup that it seemingly emits now. I can't see a win in expressing something in an idiomatic way, to have it translated to an unidiomatic output that mimics the behavior of the original idiomatic code.

Like, if you're typing the Text version, you already know it's going to be a H1. So just write that.