adobe / adobe/react-spectrum

GridList renderEmptyState cannot be a Component with Hooks

Open
#7,010 2 comments 0 reactions 0 assignees View on GitHub
needs investigation
Dominant language
TypeScript
Stars
15.9k
Forks
1.6k
Avg merge
3d 9m
Merged PRs (30d)
59

Description

### Provide a general summary of the issue here

Somewhere between version 1.2.1 and 1.3.1, a breaking change was introduced that made it so that the `renderEmptyState` prop can no longer accept a component that contains a hook

### 🤔 Expected Behavior?

To be honest, I'm split on whether this expected or not. In RAC v1.2.1, `renderDropIndicator` on the drag and drop hooks for GridList had the same restriction. Not desirable then either though...

It would be nice to be able to pass standard components in both of these cases

### 😯 Current Behavior

Passing a component that utilizes react hooks will cause React to throw a rules of hooks error

### 💁 Possible Solution

_No response_

### 🔦 Context

_No response_

### 🖥️ Steps to Reproduce

https://codesandbox.io/p/sandbox/hidden-monad-r587g3

### Version

RAC @ 1.3.1

### What browsers are you seeing the problem on?

Chrome

### If other, please specify.

_No response_

### What operating system are you using?

Mac & Windows

### 🧢 Your Company/Team

_No response_

### 🕷 Tracking Issue

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.