-2

i have a chrome extension and i made an electron app over it. i am using react js as a javascript frame work . i have like button and asset button which updates and render the component at runtime. its working in the chrome extension because of chrome.runtime API but in electron the react render method is not calling when i click a like button ,it is calling after i refresh the page .. Can you please help me out with this if anybody knows any runtime api for electron that will update and call the button component in the runtime .

saran
  • 41
  • 1
  • 1
  • 8

1 Answers1

0

For react component to render, it does not matter if its a chrome extension or electron app.

You just need to change the state or props on Button's click event, then the component will re-render regardless of the environment.

Vishal
  • 6,238
  • 10
  • 82
  • 158
  • Thanks for the suggestion .... state and props are updating , respective function are firing and at the same time redux action are calling but react render is not calling in the runtime after the page refreshes the render component is calling – saran Jun 13 '18 at 06:44
  • @saran you might have shouldComponentUpdate somewhere in your code which may be stopping the component to re-render. – Vishal Jun 13 '18 at 11:46
  • but there is no shouldComponentUpdate anywhere mentioned in the code and by the way no lifecycle methods are mentioned and it is a stateless component . i have debugged the code in the chrome extension and electron and compared both the thing is chrome extension is calling the render component when it reaches the parent component and which electron is not calling... that was the problem iam facing .... i tried defining the state and updating when button clicks but also it is behaving different way – saran Jun 13 '18 at 18:13