Skip to content

Commit 8ecda65

Browse files
Merge pull request #18 from pmajkutewicz/prop_types
"Warning: Accessing PropTypes via the main React package is deprecated" fixed
2 parents 731e86e + 3f6c8e8 commit 8ecda65

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 1.0.3 Release
2+
- Fixed warning "Accessing PropTypes via the main React package is deprecated"
3+
14
# 1.0.2 Release
25
- Fix bug where radius, blur, and max were not being used when passed in as props.
36

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-leaflet-heatmap-layer",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "A custom layer for heatmaps in react-leaflet",
55
"main": "lib/HeatmapLayer.js",
66
"scripts": {
@@ -52,6 +52,7 @@
5252
"eslint-plugin-lean-imports": "^0.3.3",
5353
"eslint-plugin-react": "^4.2.3",
5454
"leaflet": "^1.0.0",
55+
"prop-types": "^15.5.10",
5556
"react": "^15.4.1",
5657
"react-addons-test-utils": "^0.14.7",
5758
"react-dom": "^15.4.1",

src/HeatmapLayer.js

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import isNumber from 'lodash.isnumber';
88
import L from 'leaflet';
99
import { MapLayer } from 'react-leaflet';
1010
import simpleheat from 'simpleheat';
11+
import PropTypes from 'prop-types';
1112

1213
export type LngLat = {
1314
lng: number;
@@ -75,20 +76,20 @@ function shouldIgnoreLocation(loc: LngLat): boolean {
7576

7677
export default class HeatmapLayer extends MapLayer {
7778
static propTypes = {
78-
points: React.PropTypes.array.isRequired,
79-
longitudeExtractor: React.PropTypes.func.isRequired,
80-
latitudeExtractor: React.PropTypes.func.isRequired,
81-
intensityExtractor: React.PropTypes.func.isRequired,
82-
fitBoundsOnLoad: React.PropTypes.bool,
83-
fitBoundsOnUpdate: React.PropTypes.bool,
84-
onStatsUpdate: React.PropTypes.func,
79+
points: PropTypes.array.isRequired,
80+
longitudeExtractor: PropTypes.func.isRequired,
81+
latitudeExtractor: PropTypes.func.isRequired,
82+
intensityExtractor: PropTypes.func.isRequired,
83+
fitBoundsOnLoad: PropTypes.bool,
84+
fitBoundsOnUpdate: PropTypes.bool,
85+
onStatsUpdate: PropTypes.func,
8586
/* props controlling heatmap generation */
86-
max: React.PropTypes.number,
87-
radius: React.PropTypes.number,
88-
maxZoom: React.PropTypes.number,
89-
minOpacity: React.PropTypes.number,
90-
blur: React.PropTypes.number,
91-
gradient: React.PropTypes.object
87+
max: PropTypes.number,
88+
radius: PropTypes.number,
89+
maxZoom: PropTypes.number,
90+
minOpacity: PropTypes.number,
91+
blur: PropTypes.number,
92+
gradient: PropTypes.object
9293
};
9394

9495
createLeafletElement() {

0 commit comments

Comments
 (0)