Skip to content

Commit

Permalink
More 'stict:true' mode compatibility for React 17
Browse files Browse the repository at this point in the history
  • Loading branch information
mmomtchev committed Jul 10, 2021
1 parent 077dce4 commit 325ffc1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

### [1.0.4] 2021-07-10

Fix #3: Path to the example css for the layers control
Fix #4: More tsc `strict: true` mode compatibility fixes for React 17

### [1.0.3] 2021-06-24

Fix #2: Support importing from tsc with `strict: true`
Expand Down
2 changes: 1 addition & 1 deletion src/REvent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class RlayersBase<P, S> extends React.PureComponent<P, S> {
return false;
}

componentDidUpdate(prevProps: P, prev: null, snap: unknown): void {
componentDidUpdate(prevProps: Readonly<P>, prev: Readonly<unknown>, snap: unknown): void {
if (this.props !== prevProps) {
debug('willRefresh', this, prevProps, this.props);
this.refresh(prevProps);
Expand Down
6 changes: 5 additions & 1 deletion src/style/RBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ export default class RBase<P extends RBaseProps> extends React.PureComponent<
this.set(this.ol);
}

componentDidUpdate(prevProps: P, prevState: null, snapshot: unknown): void {
componentDidUpdate(
prevProps: Readonly<P>,
prevState: Readonly<unknown>,
snapshot: unknown
): void {
if (prevProps !== this.props) this.refresh(prevProps);
}

Expand Down

1 comment on commit 325ffc1

@mmomtchev
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#4

Please sign in to comment.