Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hello stereobooster, I think I found a workaround #1

Closed
zh0uquan opened this issue May 1, 2017 · 7 comments
Closed

Hello stereobooster, I think I found a workaround #1

zh0uquan opened this issue May 1, 2017 · 7 comments

Comments

@zh0uquan
Copy link

zh0uquan commented May 1, 2017

Hey stereobooster, I also wanted to do a project to use both creat-react-app and react-map-gl, I did encounter the same issue you have, that's why I am here. I just tried another mapbox react wrapper react-mapbox-gl. And I booted up an initial project...maybe you can also try it

@stereobooster
Copy link
Owner

Does it tries to look take approach of Controlled Components? E.g. HTML <input> is stateful, it is can itself respond to events (keyboard, for example) without React (Flux) data flow, but react folks managed to make input look like it is standard React component.

@zh0uquan
Copy link
Author

zh0uquan commented May 1, 2017

I don't quite get your question, but if you mean is it possible using react wrapper to control the original mapbox-gl, I guess the answer is yes. just check his demos http://alex3165.github.io/react-mapbox-gl/

@zh0uquan zh0uquan closed this as completed May 1, 2017
@stereobooster
Copy link
Owner

I don't quite get your question, but if you mean is it possible using react wrapper to control the original mapbox-gl

No. Read about Controlled Components.

By default html (pure html, no react) input can handle it's events by itself, you do not need to write JS code.

But in React you need to handle input events for it to update state:

  handleChange(event) {
    this.setState({value: event.target.value});
  }

@zh0uquan
Copy link
Author

zh0uquan commented May 2, 2017

ah.ok. I got what you are saying now. but it is out of my scope currently now, I just wanna a easy boilerplate using mapbox and react.

@stereobooster
Copy link
Owner

Well at least Marker/Popup can be done right way alex3165/react-mapbox-gl@50fca94

@zh0uquan
Copy link
Author

zh0uquan commented May 8, 2017

awesome!

@stereobooster
Copy link
Owner

Welp alex3165/react-mapbox-gl#231 😨

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants