From 5cd5449f0c0b0a379054212f482e40fcd3d51193 Mon Sep 17 00:00:00 2001 From: Martin Wighus Holtmon <martinwh@stud.ntnu.no> Date: Fri, 5 Nov 2021 16:09:15 +0100 Subject: [PATCH] projectFirstPart/Problem4 - moved rendering of the header out to the dom --- projectFirstPart/p4.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/projectFirstPart/p4.jsx b/projectFirstPart/p4.jsx index 1e29a01..733ad23 100644 --- a/projectFirstPart/p4.jsx +++ b/projectFirstPart/p4.jsx @@ -17,7 +17,6 @@ class P4 extends React.Component { render() { return( <div> - <Header /> <button type="button" onClick={this.handleButtonClick}>Switch to {this.state.nextPage.name}</button> <this.state.activePage /> </div> @@ -26,6 +25,9 @@ class P4 extends React.Component { } ReactDOM.render( - <P4/>, + <> + <Header /> + <P4 /> + </>, document.getElementById('reactapp'), ); -- GitLab