facebookarchive / react-360

Create amazing 360 and VR content using React
https://facebook.github.io/react-360
Other
8.73k stars 1.22k forks source link

type is invalid -- expected a string #568

Open atithilive opened 6 years ago

atithilive commented 6 years ago

this is my code i am getting error type is invalid -- expected a string

"react": "16.0.0",
    "react-native": "~0.49.5",
    "three": "^0.87.0",
    "react-360": "~1.0.0",
    "react-360-web": "~1.0.0"
import React from 'react';
import {
  AppRegistry, StyleSheet,Text,View,Entity,asset
} from 'react-360';
export default class Hello360 extends React.Component {
  render () {
    return (
        <Entity
             source={{
                obj: asset('human.obj'),
            }}
         />
    )
  }
}
AppRegistry.registerComponent('Hello360', () => Hello360);

screenshot from 2018-08-29 21-52-41

matthamil commented 6 years ago

Are you rendering your entity to a surface? Check the client.js file. This app root should be targeting a location:

import { Location } from "react-360-web";

// ...

 r360.renderToLocation(
  r360.createRoot("YourRootComponent"), 
  new Location([0, 0, 0]) // or your target location
);

By default, the CLI only generates a r360.renderToSurface which does not support Entities.

TL;DR:

Entities can only render to locations. If that registered app (i.e. a React tree created w/ AppRegistry.registerComponent) requires entities, make sure it is not a surface. Otherwise, set the registered app to render to a surface.

atithilive commented 6 years ago

ohh so how would i go from one 360 mono equirectangular to another 360 mono equirectangular like multiroot vr