jhen0409 / react-chrome-extension-boilerplate

Boilerplate for Chrome Extension React.js project
MIT License
2.14k stars 388 forks source link

How to use content.js script and popup.js in this architecture ?? #74

Closed 10S10 closed 7 years ago

10S10 commented 7 years ago

I have file for content.js which is actually contains Whole UI of the Extension. This is Code Snippet

import React from 'react'; import ReactDOM from 'react-dom'; import AppClass from '../../app/index'; import { Provider } from 'react-redux'; import { Store } from 'react-chrome-redux';

const store = new Store({ state: {}, portName: 'TAB_STORE' });

store.ready().then(() => { ReactDOM.render(

, document.querySelector('#root') ); });

Another File is popup.js . If I write the following code in my popup.js file then Chrome console gives me error as Failed to load resource: the server responded with a status of 404 (Not Found) popup.bundle.js

Following code I am including in popup.js

import React from 'react'; import ReactDOM from 'react-dom';

ReactDOM.render(

  ,   document.querySelector('#app')

);

My issue is I actually don't get what should i write in my popup.js.

As I am using boilerplate example so that automatically converts .js in to .html in chrome Folder.

Please help me I am stuck in this issue from last 5 days.

Thanks in advance.