• Core Java
  • Servlet
  • JSP
  • Java IO
  • RubyonRails
  • PHP
  • Struts
  • jQuery
  • Spring

  • <

    Reactjs Props

    React Props are like function arguments in JavaScript and attributes in HTML.To send props into a component, use the same syntax as HTML attributes:

    When we need immutable data in our component, we can just add props to reactDOM.render() function in main.js and use it inside our component.


    import React from 'react';
    class App extends React.Component {
       render() {
          return (
    export default App;

    import React from 'react';
    import ReactDOM from 'react-dom';
    import App from './App.jsx';
    ReactDOM.render(<App headerProp = "Header..." contentProp = "prop content"/>, document.getElementById('app'));
    export default App;

    © copyright 2017-2021 Completedone pvt ltd.