score:0

Technically, you could use any standard HTML element, so for generic ones, I don't think there's anything better than <div /> and <span />....

// loading is some prop
if (loading) {
  return <span testID='loading'>loading</span>;
}

score:1

You cannot pass props to a React fragment, it is mentioned in the docs.

Does a View not work for your use-case?

  if (loading) {
      return <View testID='loading'>loading</View>;
  }

Related Query

More Query from same tag