Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

Create Map & Map Tile components #69

Open
kevinhikaruevans opened this issue Jan 5, 2017 · 7 comments
Open

Create Map & Map Tile components #69

kevinhikaruevans opened this issue Jan 5, 2017 · 7 comments
Assignees

Comments

@kevinhikaruevans
Copy link
Owner

No description provided.

@kevinhikaruevans kevinhikaruevans self-assigned this Jan 5, 2017
@kevinhikaruevans
Copy link
Owner Author

@lamo2k123 can you take a look at this branch? https://github.com/kevinhikaruevans/uojs2/compare/get-map-data

I'm trying to send data through the websocket, but I'm getting this error:

Uncaught SyntaxError: Unexpected token o in JSON at position 1
at Object.parse ()
at WebSocket.once (transport.js:88)
once @ transport.js:88

I think it's sending "[object...]" as a string but I'm not sure why. Any ideas? 😕

@lamo2k123
Copy link
Collaborator

lamo2k123 commented Jan 7, 2017

fixed 54b3cec

@kevinhikaruevans
Copy link
Owner Author

Thanks!

I ran into another issue. I'm trying to use connect() on a component, but I'm getting this error:

Uncaught (in promise) Error: Could not find "store" in either the context or props of "Connect([component] map)". Either wrap the root component in a , or explicitly pass "store" as a prop to "Connect([component] map)".
at invariant (http://localhost:8080/bundle.js:65251:15)
at new Connect (http://localhost:8080/bundle.js:70594:58)
at http://localhost:8080/bundle.js:98048:24

I'm calling connect in map.js: https://github.com/kevinhikaruevans/uojs2/blob/get-map-data/src/client/components/map/index.js#L13

Should I pass store in props from scene/index.js?

(loaded in scene/index.js and in pages/game/index.js)

@lamo2k123
Copy link
Collaborator

The react-three-renderer implemented a method that does not render passes React context. And I think that this is not the only problem))
https://github.com/toxicFork/react-three-renderer/blob/master/src/lib/React3Renderer.js#L631

@lamo2k123
Copy link
Collaborator

Why do not you just THREEJS use?
I think that react-three-renderer is not yet a problem.

@kevinhikaruevans
Copy link
Owner Author

Like... use Three.js without react-three-renderer? I like react-three-renderer because it manages a lot of stuff.

Maybe something like:

  • Create React component, connect() to stuff
  • In render, create element
  • Rerender on prop changes?

@lamo2k123
Copy link
Collaborator

Use the '@connect' component 'scene / index.js' and there Give props to 'map' component.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants