chakra-ui / ark

Ark UI is a headless UI library with over 45+ components designed to build scalable Design Systems that works for a wide range of JS frameworks.
https://ark-ui.com
MIT License
3.8k stars 109 forks source link

Fieldset Component occurs warning about useLayoutEffect() in SSR #2977

Closed Happa8 closed 1 month ago

Happa8 commented 1 month ago

Description

Hello.

Today I found that Fieldset Component ( and useFieldset() ) occurs error such as "Warning: useLayoutEffect does nothing on the server, because its effect cannot be encoded into the server renderer's output format." . I know Field Component is already fixed in #2748 , but Fieldset Component still have same issue. This problem may fix as change useLayoutEffect() to useSafeLayoutEffect in use-fieldset.ts. https://github.com/chakra-ui/ark/blob/86da44ef05552a7f5c26c84fa18e7edc1b67934a/packages/react/src/components/fieldset/use-fieldset.ts#L34 Thank you.

Link to Reproduction (or Detailed Explanation)

N/A

Steps to Reproduce

Use Fieldset Component in SSR.

Ark UI Version

3.13.0 (may occur in v4)

Framework

Browser

No response

Additional Information

No response

Happa8 commented 1 month ago

I tried to fix this problem on #2978 I apologize if this was unnecessary.