This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from "react"; | |
| import "./styles.css"; | |
| class App extends React.Component { | |
| constructor() { | |
| super(); | |
| this.state = { | |
| counter: 0 | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from "react"; | |
| import Counter from "./Counter.js"; | |
| import Dummy from "./Dummy.js"; | |
| class App extends React.Component { | |
| constructor() { | |
| super(); | |
| this.state = { | |
| showCounterComponent: true, | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from "react"; | |
| import User from "./User.js"; | |
| class App extends React.Component { | |
| constructor() { | |
| super(); | |
| this.state = { | |
| userId: 101, | |
| }; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from "react"; | |
| class Countdown extends Component { | |
| constructor() { | |
| super(); | |
| this.state = { | |
| counter: 0, | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react'; | |
| class App extends Component { | |
| constructor() { | |
| super(); | |
| console.log( 'Inside constructor' ); | |
| } | |
| render() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react'; | |
| class App extends Component { | |
| render() { | |
| return ( | |
| <h1> Component lifecycle methods </h1> | |
| ); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import ReactDOM from 'react-dom'; | |
| import App from './App.js'; | |
| ReactDOM.render(<App />, document.querySelector("#root")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const App = function () { | |
| return ( | |
| <div> | |
| <h4 className="mt-4 text-center">Course Library</h4> | |
| <CardComponent | |
| headerText="React.js" | |
| courseComplexityType="Beginner" | |
| courseDescription="A beginner friendly course of React.js Library" | |
| /> | |
| <CardComponent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const CardComponent = function ({ | |
| headerText, | |
| courseComplexityType, | |
| courseDescription, | |
| }) { | |
| return ( | |
| <div className="card m-4"> | |
| <CourseCardHeader | |
| headerText={headerText} | |
| courseComplexityType={courseComplexityType} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const CourseCardBody = function ({ courseDescription, children }) { | |
| return ( | |
| <div className="card-body"> | |
| <p className="card-text">{courseDescription}</p> | |
| { children } | |
| </div> | |
| ); | |
| }; | |
| export default CourseCardBody; |
NewerOlder