Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It feels very unnatural to me to use React Native semantics and bolt on props for headings and the like; it seems like it would be better to write <H1> than <Text accessibilityRole="heading" accessibilityLevel={1}>, even just from a DX perspective.


Since everything is a component in React you could abstract that eg.

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


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: