Your Success component returns an array of elements. Reusing it in different components with different css layout would require wrapping it each time with something like <div className="foo-bar"><Success /></div>.
Instead your <Success> component should return a div and optionally accept className prop.
Please, don't return an array/fragment as a component's render result unless it conditionally resolves into one element. It really harms reusability.
I don't understand. I didn't propose that at all?
Your
Successcomponent returns an array of elements. Reusing it in different components with different css layout would require wrapping it each time with something like<div className="foo-bar"><Success /></div>.Instead your
<Success>component should return adivand optionally acceptclassNameprop.use a Fragment?
Fragment is not an element, it doesn't accept
className.