How function interact within the component system in react?

Answer

Example-ComponentA imports App.js and attempts to assign App.functionA to functionB and then call it in the JSX. This results in a failure basically saying that the function is not defined.

import React from ‘/react;
import ReactDOM from ‘/react-dom;
import App from ‘./App.js;

ReactDOM.render(<App />, document.getElementById(‘root));
import React from ‘/react;

class App extends React.Component {
constructor(props) {
super(props);
this.state = {someProp = ‘};
};

functionA = (e) => console.log(e);

All react js Questions

Ask your interview questions on react-js

Write Your comment or Questions if you want the answers on react-js from react-js Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---