#React: Use a Runtime Null Check
4 messages · Page 1 of 1 (latest)
either it throws an error because React cannot mount
or you throw manually
in both cases you throw an error
so unless you handle it in a special way, I don't see the point of throwing your own errors
also I think assuming the root element exists is a fair assumption
it needs to be hardcoded in your html anyway