import React from 'react';
      import { Link } from 'react-router-dom'
      class ExpenseEntryItemForm extends React.Component {
        constructor(props) {
        render() {
          return (
              <h1>Add Expense item</h1>
              <p><Link to="/list">Click here</Link> to view new expense list</p>
                Expense form
      export default ExpenseEntryItemForm;

      Javascript language logo
      your recipe card header background
      Expense Entry Item Form

      React Project

      In this code, we are importing React and React Router. We are also importing the Link component.

      We are creating a class named ExpenseEntryItemForm. This class will extend the React.Component class. In the class constructor, we are supering the props. We are also setting up some default values for the class.

      Next, we are going to create a render() function. In this function, we are going to return an HTML paragraph, with an heading titled Add Expense item and a link titled Click here to view new expense list. We are also going to include a form element inside of the paragraph. This form element will have the following attributes:

      Title: Add Expense item

      Link: Click here

      We are also going to add a div element inside of the paragraph, which will be the container for the Expense form.

      Now that we have created our class, we need to create an instance of it. We can do this by calling the constructor, passing in the appropriate props. We are also going to pass in the context of the React Router instance.

      Next, we are going to use the Router instance to get a path to our list. We are going to use the


        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.