How can you embed two or more components into one?

Forums ReactHow can you embed two or more components into one?
Staff asked 12 months ago

Is there any way to embed two or more functional components into one functional component? If yes, then how to code.

Yes, It Is Possible.

Hit Sutariya replied 11 months ago

Answers (1)

Add Answer
Hit Sutariya Marked As Accepted
Staff answered 11 months ago
import React from 'react';

export default function First() {
    return (
        <div>
            First Component
        </div>
    )
}

export function Second() {
    return (
        <div>
            Second Component
        </div>
    )
}

Subscribe

Select Categories