How can you embed two or more components into one?

Forums ReactHow can you embed two or more components into one?
Staff asked 4 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 3 months ago

Answers (1)

Add Answer
Hit Sutariya Marked As Accepted
Staff answered 3 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