Skip to content
This repository has been archived by the owner on Oct 14, 2020. It is now read-only.

[TBD] Make statusbar mutations obvious #17

Open
dmtrKovalenko opened this issue Mar 29, 2019 · 4 comments
Open

[TBD] Make statusbar mutations obvious #17

dmtrKovalenko opened this issue Mar 29, 2019 · 4 comments
Labels
question Further information is requested

Comments

@dmtrKovalenko
Copy link
Collaborator

Reason

The main reason for this issue is that now it's really not obvious that status-bar mutates the state. For me, before I started maintaining this project, this module looks like a View rendering on top of everything other, with the position absolute. And that wasn't really clear that there is no state, but only mutations.

That can really lead the bugs. I want to make it more clear, that there is no rendering at all in the StatusBar component. Only mutation in the lifecycle hooks. And currently, codebase is a bit smells as from my point of view.

Solution

I am thinking about getting rid of the component at all. Just provide the hook.

useStatusBarMutation({ hidden: true, animation: "fade" )}

This will internally use useEffect and will not make additional calling to the native module, as static methods right now.

P.S.: This is open to discussion, want to know what @cpojer thinking about that.

@thymikee
Copy link

I'm supportive to that. I'd just make sure to:

  1. Introduce hooks next to legacy component API
  2. produce a warning that the component is going away in the next major version so please migrate to hooks or imperative module calling (with links to migration guide)
  3. Remove component in a major version bump

@krizzu
Copy link

krizzu commented Jun 12, 2019

Happy to see that change, same as you, found it confusing to use it as a component.

@dmtrKovalenko
Copy link
Collaborator Author

Will work on that!

@Marcello168
Copy link

@thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants