Skip to content

Commit

Permalink
test: memo and forwardRef testcase add
Browse files Browse the repository at this point in the history
  • Loading branch information
developer-bandi committed Jan 14, 2024
1 parent 49f5dad commit f41b6f3
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions tests/lib/rules/prop-types.js
Expand Up @@ -4141,6 +4141,46 @@ ruleTester.run('prop-types', rule, {
};
`,
features: ['ts', 'no-babel'],
},
{
code: `
import React, { forwardRef, memo } from 'react';
interface Props1 {
age: number;
}
const HelloTemp = memo(({ age }: Props1) => {
return <div>Hello {age}</div>;
});
export const Hello = HelloTemp
`,
features: ['types'],
},
{
code: `
import React, { forwardRef, memo } from 'react';
interface Props1 {
age: number;
}
const HelloTemp = forwardRef(({ age }: Props1) => {
return <div>Hello {age}</div>;
});
export const Hello = memo(HelloTemp);
`,
features: ['types'],
},
{
code: `
import React, { forwardRef, memo } from 'react';
interface Props1 {
age: number;
}
export const Hello = memo(
forwardRef(({ age }: Props1) => {
return <div>Hello {age}</div>;
}),
);
`,
features: ['types'],
}
)),

Expand Down

0 comments on commit f41b6f3

Please sign in to comment.