Skip to content

Init markersDispatcher_ on componentDidMount #1146

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

Merged
merged 1 commit into from
May 14, 2023

Conversation

bordeo
Copy link
Contributor

@bordeo bordeo commented Sep 28, 2022

@mcgrealife
Copy link

mcgrealife commented Oct 5, 2022

To help future reviewers parse important changes:

Primary (screenshot):

  1. Upgrade react and react-dom
  2. Init markersDispatcher_ on componentDidMount
  3. Update package.json start command

important changes

Secondary:

  • Update example
  • Formatting (semicolons, spacing)

@Eslam3bed
Copy link

Thanks, @bordeo for the initiative
any updates on when this will be reviewed 👀

@Eslam3bed
Copy link

@itsmichaeldiego can we have your help on this 🙏🏼 ?

@barroudjo
Copy link

barroudjo commented Oct 24, 2022

I'm sorry, but I tried to use your fork in my project, and it doesn't solve the issue of having the markers jump...

(in my package.json I put "google-map-react": "https://github.com/bordeo/google-map-react.git",, and I checked that in node_modules your modifications were included, and they were)

@KasimAhmic
Copy link

Any rough estimate as to when this can get merged?

@RobinGranstromKall
Copy link

I have tried installing the fork and it does solve the issues with react 18 and i can now run the package in my React 18 library.
However, the markers are now first placed in the correct spot, but when i pan the view the markers will first stick to the correct position but after jump to their original place relative to the viewbox.

@edzis
Copy link

edzis commented Nov 18, 2022

Here is my trail of issues related to React 18 if it helps anyone to follow through:

v2.1.10:

  • markers jitter after drag
  • in StrictMode causes infinite crash loop

See https://www.loom.com/share/8a010b76a6504d11b6d6e3a6fae83b1a

This PR #1146

  • based on v2.1.10
  • does not fix jitter
  • fixes StrictMode crash loop
  • in StrictMode causes markers to move to original position after drag

See https://www.loom.com/share/2995f667d363417ba9fe4b4286e72aee

My PR https://github.com/deliverty/google-map-react/pull/1

  • based on this PR
  • applies patch from from React 18 Support #1102 (comment) by @sud977
  • fixes jitter
  • introduces Warning: flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.

See https://www.loom.com/share/cb6c55ae652c4b17a8efb9924a1f0ccb


For now I am settling for my PR and without StrictMode.

@neo0910
Copy link

neo0910 commented Apr 11, 2023

Hello!
Will this PR be merged?

@itsmichaeldiego itsmichaeldiego merged commit 8e2ae4d into google-map-react:master May 14, 2023
@itsmichaeldiego
Copy link
Member

Merged and published in version: 2.2.1, please let me know if it works for you, thanks!

@giorgiabosello
Copy link

giorgiabosello commented May 14, 2023

@itsmichaeldiego did you tried it before merging it?
http://google-map-react.github.io/google-map-react/map/main/ if you zoom, markers change with it because they are not reinitialized.

@itsmichaeldiego
Copy link
Member

@giorgiabosello That issue is not related to this version! We don't use that map example anymore!
Please check in your local and let me know, thanks :D

@giorgiabosello
Copy link

@itsmichaeldiego same 😅

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

Successfully merging this pull request may close these issues.

10 participants