Skip to content

docs: react quick start guide does not mention withRouter when passing history as prop #3553

Open
@DunhamGitHub

Description

@DunhamGitHub

Prerequisites

Ionic Framework Version

v7.x

Current Behavior

Trying to follow the simplest vanilla example (https://ionicframework.com/docs/react/quickstart), but getting an error:

image

Expected Behavior

No error in App.tsx when adding RouteComponentProps in Home.tsx

Steps to Reproduce

  1. Follow the vanilla tutorial :https://ionicframework.com/docs/react/quickstart
  2. Last step, before the error, is adding RouteComponentProps to const Home: React.FC = () => { so it becomes const Home: React.FC<RouteComponentProps> = () => { ...in Home.tsx (I am assuming all this is done in Home.tsx, the tutorial does not say...)
  3. Importing RouteComponents import { RouteComponentProps } from "react-router-dom"; (not documented in the tutorial)
  4. Switching to App.tsx show the error now (see "Current Behavior")

Code Reproduction URL

b

Ionic Info

Ionic:

   Ionic CLI       : 7.2.0 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework : @ionic/react 7.8.0

Capacitor:

   Capacitor CLI      : 5.7.3
   @capacitor/android : not installed
   @capacitor/core    : 5.7.3
   @capacitor/ios     : not installed

Utility:

   cordova-res : not installed globally
   native-run  : 2.0.1

System:

   NodeJS : v20.11.1 (/usr/local/Cellar/node@20/20.11.1/bin/node)
   npm    : 10.2.4
   OS     : macOS Unknown

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    contentIssues related to the contents of the documentation websitepackage: reactIssues related to the Ionic React documentation

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions