Integrate react app with gmail sidebar:

212 views
Skip to first unread message

Umer Iqbal

unread,
Apr 26, 2022, 1:56:41 PM4/26/22
to InboxSDK
Hi,

I am trying to build a chrome extension using inboxsdk  + React. I have install npm of @inbox/core and I am using webpack. But I am getting this error.Screen Shot 2022-04-26 at 10.47.34 PM.png
I have the following  code:

import React from "react";
import { render } from "react-dom";
import InboxSDK from "@inboxsdk/core";
import { LoaderOptionsPlugin } from "webpack";

function Popup(){
return (
<div>
<h1>Hello World!!!</h1>
<p>Hello World!!!</p>
</div>
);
}



InboxSDK.load(2, 'sdk_gExtensionDemo_7aad930d16').then(sdk => {

sdk.Global.addSidebarContentPanel({
title: 'Sidebar Example',
iconUrl: chrome.runtime.getURL('monkey.png'),
el: render(<Popup/>,document.getElementById("react-target"))
});
});

Its working fine when i run it with out inboxsdk. Please help 
Thanks,
Reply all
Reply to author
Forward
0 new messages