Is there a way to tell if ReactElement renders “null”?

No, there’s no way to determine what a child will render using React. The standard way to do this is to expose some utility function that says whether A will render.

Something like:

if (AUtils.isStoryValid(story)) {
  return <A story={story} />;
} else {
  return <B story={story} />;
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)