Sample App React-Spectrum

ursboller

MVP

27-05-2020

I started using the example app, but I'm having a hard time to get navigation up and running.

Is there any example about a simple app with a "header" (top navigation with a few sample entries) and some components (as routes for the header nav?

would save me a lot of time to start with a simple template instead trying to figure out how react-spectrum should be used (especially the state change)....

remark: no need for big contents in the components, some simple text pages is far enough. it's more about the handling of the spa router together with authentication...

Accepted Solutions (1)

Accepted Solutions (1)

StephanAdobe

Employee

28-05-2020

Hi @ursboller 

 

I recommend to use react-router to handle navigation in your app. Here is a simple working example that shows how to set up navigation.

 

Also if you plan to use TypeScript + React JSX, you should add a tsconfig.json file under your web-src folder with the following config:

 

{
  "compilerOptions": {
    "jsx": "react"
  }
}

 

See https://en.parceljs.org/typeScript.html#when-using-react for more information.

 

Regards,

Stephan

Answers (1)

Answers (1)

sarahxxu

27-05-2020

Hi @ursboller 

I think we do have some sample applications (see "Code Labs" on this page https://www.adobe.io/apis/experienceplatform/project-firefly/docs.html#!AdobeDocs/project-firefly/ma...). However, I don't think we have one showing top nav and route mapping like the one you are asking for. I can share the feedback with our enablement team and see if they have anything ready to share!

In the meantime -- perhaps some existing React tutorials around routing would help?

Sarah