'React subpage appearing on main page
I am creating a webpage that has a main dashboard for a writer that shows a table with all their works submitted and right now I am trying to add a button to bring up a form to submit a new piece of work. Here is that table code for the main dashboard.
<h2>Writer Dashboard</h2>
<Link className="createReview" to="/WriterDash/review">Create Review</Link>
<div className="writertable">
<table>
<thead>
<tr>
<th>User</th>
<th>Author</th>
<th>Title</th>
<th>Body</th>
</tr>
</thead>
<tbody>
{userDisplay.map((val) => (
<tr>
<td>{val.user}</td>
<td>{val.user}</td>
<td>{val.title}</td>
<td>{val.body}</td>
</tr>
))};
</tbody>
</table>
</div>
In the code above my "button" is the (Line 2) because from what I read button linking doesn't play well with this idea either. This link is going to a subpage, review, that will bring up a page to submit a form. Here is the layout for the review page:
<div className="review">
<div className="createSection">
<h2>Step1: Set Review Details</h2>
</div>
<p>Provide the descriptive settings of this review and enable features.</p>
<table className="createSectionTable">
<thread></thread>
<tbody>
<tr>
<td>Title</td>
<td>
<input type="text" name="title" id="title"></input>
</td>
</tr>
<tr>
<td>Instructions</td>
<td>
<input class="instructions" id="instructions"></input>
</td>
</tr>
</tbody>
</table>
<div class="selectWriting">
<h2>Step 2: Select Writing for Review</h2>
<p>Specify Writing to be Reviewed</p>
</div>
<div class="selectReviewer">
<h2>Step 3: Select Reviewer</h2>
</div>
<div class="reponseType">
<h2>Step 4: Add Reponse Type</h2>
{/* <input type="checkbox" id="test" onClick="test()">Test</input> */}
</div>
</div>
The problem I am running into is when I click on my "Create Review" Button/Link it will change the link in the URL but it just pastes the material on the Review page directly under the material on the Main Dashboard. Is the problem because I am making subpages "mainPage/subPage"? I was looking to make more subpages from the main dashboard so any advice would be helpful.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
