score:1
Accepted answer
it's not a react problem but rather a bundler issue. if you are using webpack, you need to have multiple entry points.
e.g.
entry: {
popup: path.join('src', 'popup', 'index.js'),
background: path.join('src', 'background', 'index.js'),
content: path.join('src', 'content', 'index.js'),
},
inside your webpack.config.js.
if you are interested in boilerplate that provides this functionality, you can look at https://github.com/anilredshift/chrome-extension-webpack-boilerplate
Source: stackoverflow.com
Related Query
- React Chrome Extension with Multiple scripts
- How to set up a chrome extension using React and TypeScript with multiple pages and entry points?
- change value of input made with react from chrome extension
- How to link/reference multiple scripts in an html file with react (WITHOUT NODE.js)?
- There is a problem in making multiple select boxes with react and type scripts
- Chrome extension manifest v3 with React
- I am doing a chrome extension with react but it refuses to execute inline script
- Chrome Extension with React + MaterialUI - Table did not get filled with data
- React "Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node" with Chrome Extension
- Retrieving value from <select> with multiple option in React
- Multiple params with React Router
- React Router v4 with multiple layouts
- Multiple classNames with CSS Modules and React
- Exporting React component with multiple HOC wrappers?
- Is there any way to see names of 'fields' in React multiple state with React DevTools when using 'useState' hooks
- React slow with multiple controlled text inputs
- How to close a React Navigation modal with multiple screens in it
- React app slows to a crawl with chrome developer tools open. Works fine in incognito
- Modify React Component's State using jQuery/Plain Javascript from Chrome Extension
- Match multiple path with react router v4
- React form with multiple buttons - how to choose one to handle onSubmit event?
- Serving multiple react apps with client-side routing in Express
- using react js in Chrome extension
- Do I have to save react component files with a jsx extension
- How to use React Hooks Context with multiple values for Providers
- Receiving 401 status with Safari not Chrome in React
- Multiple fetch data axios with React Hooks
- Routing in Chrome Extension written in React
- TypeError: Cannot read property 'error' of undefined on React Chrome Extension
- Multiple Layouts with React Router v4
More Query from same tag
- Executing function on click gives errors
- I can't change field in state
- Enzyme mock function before componentWillMount
- how to attach custom event handlers in react?
- Input sanitization in ReactJS
- Can you choose which pages show "add to homescreen"
- Data fetching from graphql server with ApolloClient doesn t work. How can I fix it?
- How to filter an object list on multiple arrays in react.js?
- Make <br /> from string works in react
- Add image/button to React bootstrap table cell based on value of cell
- API calls in componentDidUpdate and componentWillReceiveProps
- can't declare url and path variables in useRouteMatch
- React's SetState is not updating
- Dynamic background image for reusable components using inline style
- React highchart: Shared tooltip in same and different chart
- Running npm run eject to use css modules
- How to make checkered chess board pattern with CSS
- How to replace array.join using a comma with using a line break
- refs vs onChange
- ReactJS Material-UI how to fix a component on top of an anchored menu
- typescript how to omit enum values
- Is there a way to get the height of a div set to `overflow-y: auto`
- Why can't I change my input value in React even with the onChange listener
- How to convert File into Tensor in JavaScript
- How to update a value in destructing and loop
- How to use environment variables in Github Page?
- React Router V6 Class props empty
- How to use AND and OR statement inside the component while comparing in react component
- generate many components from an array
- Property Does Not Exist on TypeOf, Understanding Classes Better