Skip to content

Commit

Permalink
fix: 修复 React is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
wangxingkang committed Jan 25, 2024
1 parent ed7cf51 commit c8e72c9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/Marker/marker.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useImperativeHandle } from 'react';
import Mapbox from 'mapbox-gl';
import { useGetState, usePortal } from '@pansy/react-hooks';
import { forwardRef, useEffect, useImperativeHandle } from 'react';
import { useMap } from '../../hooks/useMap';
import { usePropsReactive } from '../../hooks/usePropsReactive';
import { useEvents } from '../../hooks/useEvents';
Expand All @@ -9,7 +9,7 @@ import { MarkerEventMap, MarkerEventList } from './constant';

import type { MarkerProps, PropKey, MapboxMarker, MarkerOptions } from './types';

export const Marker = forwardRef<MapboxMarker, MarkerProps>((props, ref) => {
export const Marker = React.forwardRef<MapboxMarker, MarkerProps>((props, ref) => {
const { map } = useMap();
const { Portal, container } = usePortal();
const [marker, setMarker, getMarker] = useGetState<MapboxMarker>();
Expand Down
9 changes: 8 additions & 1 deletion src/components/MarkerCluster/MarkerCluster.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { useState, useMemo, useEffect, useCallback, useImperativeHandle, forwardRef } from 'react';
import React, {
useState,
useMemo,
useEffect,
useCallback,
useImperativeHandle,
forwardRef,
} from 'react';
import { isFunction, uuid } from '@pansy/shared';
import { LngLatBounds } from 'mapbox-gl';
import Supercluster from 'supercluster';
Expand Down

0 comments on commit c8e72c9

Please sign in to comment.