Skip to content

Commit

Permalink
fix(layer-selector): remove use of deprecated defaultProps
Browse files Browse the repository at this point in the history
Support for this was removed at react 19.
  • Loading branch information
stdavis committed Jan 8, 2025
1 parent acbdb3b commit 5f69f4e
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions packages/layer-selector/src/LayerSelector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,17 @@ const createLayerFactories = (

const ConditionalWrapper = ({ condition, wrapper, children }) =>
condition ? wrapper(children) : children;

const defaultProps = {
makeExpandable: true,
position: 'top-right',
showOpacitySlider: false,
};
const LayerSelector = (props) => {
props = {
...defaultProps,
...props,
};
const [layers, setLayers] = useState({
baseLayers: [],
overlays: [],
Expand Down Expand Up @@ -580,12 +590,6 @@ LayerSelector.propTypes = {
showOpacitySlider: PropTypes.bool,
};

LayerSelector.defaultProps = {
makeExpandable: true,
position: 'top-right',
showOpacitySlider: false,
};

LayerSelectorItem.propTypes = {
onChange: PropTypes.func.isRequired,
selected: PropTypes.bool.isRequired,
Expand Down

0 comments on commit 5f69f4e

Please sign in to comment.