Your idea is nice. However I think having an component would be overkill. Since the embed conditional rendering is already good.
I’d like to add a bit. Since you want to render the ComponentX only with some conditions, it’d be better if you could lazy load it. So it will be downloaded only when we need, therefore downsize the initial bundle. Lazy and Suspense can help you to do it.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Your idea is nice. However I think having an component would be overkill. Since the embed conditional rendering is already good.
I’d like to add a bit. Since you want to render the ComponentX only with some conditions, it’d be better if you could lazy load it. So it will be downloaded only when we need, therefore downsize the initial bundle. Lazy and Suspense can help you to do it.