Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial state handling seems broken in 1.6.2, re-switched to 1.6.1 and it's working fine #481

Open
ReactiveFilos opened this issue Oct 8, 2024 · 4 comments

Comments

@ReactiveFilos
Copy link

ReactiveFilos commented Oct 8, 2024

I'm in Expo React Native.
Initial state:
const [isCollapsed, setIsCollapsed] = useState<boolean>(false);

Simply using <Collapsible collapsed={isCollapsed}>
with a toggle in a <PressableScale onPress={() => setIsCollapsed((prev) => !prev)}>

Problem is the component just starts closed not caring of initail state passed as prop.
useEffect on mount setting isCollapsed STILL to false triggers a re-rendering making it to open.

Switching back to 1.6.1 worked fine.

@IndrakumarR
Copy link

I'm in Expo React Native. Initial state: const [isCollapsed, setIsCollapsed] = useState<boolean>(false);

Simply using <Collapsible collapsed={isCollapsed}> with a toggle in a <PressableScale onPress={() => setIsCollapsed((prev) => !prev)}>

Problem is the component just starts closed not caring of initail state passed as prop. useEffect on mount setting isCollapsed STILL to false triggers a re-rendering making it to open.

Switching back to 1.6.1 worked fine.

👍

@malikzype
Copy link

Facing Same issue. Works fine on 1.6.1

@colbymchenry
Copy link

I'm getting the issue as well.

@C0rren
Copy link

C0rren commented Oct 30, 2024

Same issue, reverted to 1.6.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants