react-google-maps-api
react-google-maps-api copied to clipboard
Documentation for Function Components such as `MarkerF`
Issue template
Please provide an explanation of the issue
Hi there, first of all, thanks for your hard work on @react-google-maps/api
!
I wanted to ask if you would be open to writing some documentation for the function components introduced in 2.10.0
such as MarkerF
.
Right now they seem to be undocumented, aside from comments hidden in issues like this where your comment mentions them shortly as the way to go with React 18 (which is now the latest stable version of React):
use MarkerF instead for react@18
MarkerF is hook based, and has no issues.
Your Environment
os: macOS Monterey
node --version: 16.11.0
react version: 18
webpack version: Next.js 12.2.0 built-in
@babel version: No Babel, using SWC in Next.js
@react-google-maps/api version: 2.12.0
How does it behave?
Using Marker
and other non-function components does not work with React 18, and the function components such as MarkerF
are undocumented
How should it behave correctly?
The documentation should recommend the function components, since the other components do not work with the latest version of React and the philosophy of React is hooks-first.
Basic implementation of incorrect behavior in codesandbox.com
This is a request for a docs change, so no CodeSandbox.
@karlhorky Sorry I got sick covid last month and do not have energy to work on docs, or add new F components. I still can merge PR and release new versions
Also, We have broken docs, cos docs lib is unmaintained and require replacement. Build is broken, and fresh docs were not deployed to netlify more than a year. Very outdated docs still deployed.
Ohh really sorry to hear! Hope that you feel better quick.
Totally understand that it's tough to keep everything up to date. Maybe there could be some small changes only to the readme to recommend using the function components... 🤔 That would probably already go a long way.
Hello, I am wondering if there is any news about this issue. I am in dire need of an answer. Thank you
any news?
Please add information in docs, it's hard to find some solutions from Issue comments