React routing with multiple components

Is there a way to include multiple components when using React to switch scenes? In the tutorial video they only have one component attached to the scene where I would need multiple components attached. What is the syntax to include multiple components?

const SpoonScene = withRouter(({match}) => (
<React.Fragment>

<AFrameScene
sceneHtml={require(‘./spoon.html’)}
components={TreeSceneComponents} /// HERE I WOULD LIKE TO INCLUDE TWO OR MORE??
/>
</React.Fragment>
))

Hi @Bill_Sullivan , you sure can, in your case TreeSceneComponents would be an array of name/val objects

Check out this example:

const ArtGalleryComponents = [
  {name: 'artgalleryframe', val: ArtgalleryFrameComponent},
  {name: 'info-display', val: InfoDisplayComponent},
]

and then React App | 8th Wall | 8th Wall

components={ArtGalleryComponents}

Hi Tony, Thanks for this, I tried a number of things but I think this is more clear then what I had gotten from others.

1 Like