Skip to content

Commit

Permalink
🤖 Merge PR #69124 [react-recompose] Replace usage of deprecated types…
Browse files Browse the repository at this point in the history
… related to propTypes with their counterpart from the prop-types package by @eps1lon
  • Loading branch information
eps1lon committed Mar 28, 2024
1 parent 5b253b2 commit 518b9ae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions types/react-recompose/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/// <reference types="react" />

declare module "react-recompose" {
import type * as PropTypes from "prop-types";
import * as React from "react";
import { ComponentClass, ComponentType as Component, FunctionComponent, ValidationMap } from "react";
import { ComponentClass, ComponentType as Component, FunctionComponent } from "react";

type mapper<TInner, TOutter> = (input: TInner) => TOutter;
type predicate<T> = mapper<T, boolean>;
Expand Down Expand Up @@ -209,13 +210,13 @@ declare module "react-recompose" {

// withContext: https://github.com/react-recompose/react-recompose/blob/main/docs/API.md#withContext
export function withContext<TContext, TProps>(
childContextTypes: ValidationMap<TContext>,
childContextTypes: PropTypes.ValidationMap<TContext>,
getChildContext: mapper<TProps, any>,
): InferableComponentEnhancer<{}>;

// getContext: https://github.com/react-recompose/react-recompose/blob/main/docs/API.md#getContext
export function getContext<TContext>(
contextTypes: ValidationMap<TContext>,
contextTypes: PropTypes.ValidationMap<TContext>,
): InferableComponentEnhancer<TContext>;

interface _ReactLifeCycleFunctionsThisArguments<TProps, TState> {
Expand Down Expand Up @@ -320,7 +321,7 @@ declare module "react-recompose" {

// setPropTypes: https://github.com/react-recompose/react-recompose/blob/main/docs/API.md#setPropTypes
export function setPropTypes<P>(
propTypes: ValidationMap<P>,
propTypes: PropTypes.ValidationMap<P>,
): <T extends Component<P>>(component: T) => T;

// setDisplayName: https://github.com/react-recompose/react-recompose/blob/main/docs/API.md#setDisplayName
Expand Down
2 changes: 1 addition & 1 deletion types/react-recompose/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"https://github.com/react-recompose/react-recompose"
],
"dependencies": {
"@types/prop-types": "*",
"@types/react": "*"
},
"devDependencies": {
"@types/prop-types": "*",
"@types/react-recompose": "workspace:."
},
"owners": [
Expand Down

0 comments on commit 518b9ae

Please sign in to comment.