How can you embed two or more components into one?

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

Answers (1)

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