facebookarchive / react-360

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

Wrong code snippet on ReactVR Docs page (3D Coordinates and Transforms) #408

Closed harshalgajjar closed 6 years ago

harshalgajjar commented 6 years ago

Description

The code provided under "React VR Uses the OpenGL® 3D Coordinate System" sections is as follows:

  <Text style={{ position: 'absolute', transform: [{translate: [0, 0, -6]}],
           layoutOrigin: [0.5, 0.5] }}
  fontSize={0.4} text='Office Lobby' />

I just started learning ReactVR, I'm guessing the above code is for a previous version.

Solution

It should instead be:

   <Text style={{ position: 'absolute' , transform: [{translate: [0, 0, -6]}],
         layoutOrigin: [0.5, 0.5], fontSize: 0.4 }} >Office Lobby
   </Text>

Additional Information

andrewimm commented 6 years ago

Good catch, we moved that into styles between the pre-release and v1.0.0. Feel free to submit a PR

RadValentin commented 6 years ago

Already fixed this in https://github.com/facebook/react-vr/pull/385, see commit https://github.com/RadValentin/react-vr/commit/dcbb83b740292d24e007c866cbf42bab4439fdf1

If someone could help with a review, it would prevent other issues like this being opened.