score:1
Accepted answer
you can use window.electron.ipcrenderer
in react component
ipcrenderer should be required in preload.js
, preload is a param of browserwindow webpreferences.
mainwindow = new browserwindow({
show: false,
width: 1024,
height: 728,
icon: getassetpath('icon.png'),
webpreferences: {
preload: path.join(__dirname, 'preload.js'),
},
});
please refer: https://github.com/electron-react-boilerplate/electron-react-boilerplate/blob/main/src/main/main.ts
Source: stackoverflow.com
Related Query
- How to pass React click events to electron
- How to handle click events on child components in React.js, is there a React "way"?
- How to pass react hook state to another component for each click
- How to pass data by button click in redux react js
- How to pass data between to independent component on button click in React JS?
- How to pass text box value to sibling component in react on button click
- How to pass argument to ref click method using react and javascript?
- How to handle click events on divs with React and Typescript
- How to get React button's click events and class name from vanilla javascript?
- How to pass link to react ant design model "Confirm/yes/ok " click button
- React - How to pass props on click text to image
- How to pass data from child to parent on click of a button in the parent React
- How to send events from electron to react components only after all components are ready?
- How to pass the value outside of the arrary while click on button in React js , React slick carousel?
- How to pass in a react component into another react component to transclude the first component's content?
- React - How to pass HTML tags in props?
- How to listen for click events that are outside of a component
- How to send request on click React Hooks way?
- React Synthetic Event distinguish Left and Right click events
- React - how to pass state to another component
- How to pass all other props to react class?
- React - How to pass props to a component passed as prop
- How to navigate on path by button click in react router v4?
- How to pass arguments to functions in React js?
- How to pass several props in spread operator in react
- How to print React component on click of a button?
- React router and this.props.children - how to pass state to this.props.children
- How to pass state values to initial values in formik in react js
- How to pass a state className variable to another component in react
- How can I pass a variable from 'outside' to a react app?
More Query from same tag
- Handling React Checkbox States and Toggling Row Color for React Table
- Child component not rerendering on change of props
- Ref is not applied to react sound
- Override the transition delay in React Framer Motion
- Check the render method of `App`
- How can I have multiple states in useState hook
- Iterate through an array to send in Sendgrid tranactional email template?
- use of variable inside render function of react component
- React Web Navbar Tree Menu Activation
- Class assign in React
- Add a carat to a navigation item with the class active that doesn't push the nav icon out of the div
- How to correctly type a simple useReducer and Context-api in typescript
- How to redirect non www to www and http to https?
- How to modify a specific component of a list of component rendered using map in react?
- How to access return value of a method in classname field in ReactJS?
- Dynamic-like Express routing for dynamic-object to print
- How to correctly use switch statement in JSX (react)?
- using useState and External Filters in reactJS
- When using aws amplify on react to make an call to api gateway, how do i go about getting the statuscode as well?
- React ref.current is null in useEffect cleanup function
- Es6 map array with html doesn't work in JSX?
- How to trigger submit from parent?
- displaying <li> elements left and right side according to the condition
- how to map this given json data in react js
- How to set inital state from props after fetch?
- React, variable speed Clock with setTimeout
- Display an array of objects row-by-row using React Table?
- React Lazyload as soon as page interacted with
- making a post request inside mapDispatchToProps in react-redux
- React hooks state not using latest