Hi @Jack-9275 ,
In SharePoint Framework, you can use GraphHttpClient to connect and get groups:
Consume the Microsoft Graph in the SharePoint Framework
And in the solution demo above, if you want to select Office 365 Group, change this to principalType: [PrincipalType.Security] in SampleTargetedComponentWebPart.ts:
If the response is helpful, please click "Accept Answer" and upvote it.