You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can you please tell what behaviour is expected so that I can come up with a PR that fixes either the test or the behaviour? To me it seems that the actual behaviour is alright since all ids are unique. Also the logic behind generation in the actual result can be inferred just by looking and the code sample. In the expected result it's not clear why the first prefix is incremented in the second id but not incremented in the third id.
🐛 Bug Report
Given this tree of SSR providers (cribbing from SSRProvider.test.js):
Each
<Test>
, when callinguseId
, should get a unique ID, but two of those tests do not.🤔 Expected Behavior
I don't have a preference for what the IDs are so long as they are unique and namespaced and deterministic.
😯 Current Behavior
Here's a snapshot test showing the current behavior:
💁 Possible Solution
I believe a possible fix would be making each ID essentially a path through the tree of
SSRProvider
s, so that for the above example, the IDs would be:🔦 Context
I stumbled into this looking at different implementations for SSR-stable unique ID generation in react.
💻 Code Sample
See the current behavior above
🌍 Your Environment
I was running tests on main as of 2021 Aug 12 (v3.0.3 of
@react-aria/ssr
)The text was updated successfully, but these errors were encountered: