Skip to content

False positive when a customHOC receives a component wrapped in forwardRef #79

@tylerlaprade

Description

@tylerlaprade
export default withPeriodSpecificGridWrapper(
  forwardRef(SiteGrid),
  PeriodGridBlobType.SITE_COST_MATRIX,
);

This is in a file that declares the React component SiteGrid (and doesn't export it). I never use SiteGrid standalone - the forwardRef and withPeriodSpecificGridWrapper are effectively part of the component itself. It's my understanding this should be allowed given my config:

		"react-refresh/only-export-components": [
			"error",
			{
				"allowConstantExport": true,
				"customHOCs": ["withPeriodSpecificGridWrapper"]
			}
		],

Also, I'm not seeing any Vite errors when editing this file like I do with the files with actual problematic exports.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions