Skip to content

mobx-persist-store: minified bundle issue with <Class>.name usage #11

@sebastianjung

Description

@sebastianjung

Describe the bug
When using the approach shown in this example, where <Class>.name is being used as the name option, the minified bundle is giving warnings. Additionally, the app behaviour is impacted as hydration does not work as expected in some cases and state is lost.

To Reproduce
Steps to reproduce the behavior:

  1. Follow the approach in the example and use <Class>.name as the name for the name option.
  2. Generate a dev build: eas build --platform ios --profile development
  3. Generate a minified bundle: npx expo start --dev-client --minify
  4. Notice the warning in LogBox, and observe potential unexpected app behavior

Expected behavior
<Class>.name should be able to be used as a storage name without causing warnings or affecting app behavior.

Warning
mobx-persists-store: 'makePersistable' was called with the same storage name "t"

Environment

  • ios development: warning + behaviour
  • ios staging build ("developmentClient": false): behaviour only

Possible Solution
using static string values instead, like name: 'CounterStore'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions