Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

DurationFormat.format is very slow and blocking JS thread #4522

Copy link
Copy link
@AlixH

Description

@AlixH
Issue body actions

Which package?

"@formatjs/intl-durationformat": "^0.2.4",

Describe the bug

I am using formatJS in my React Native app. I am importing several polyfills for each locales as described here: https://formatjs.io/docs/polyfills/intl-durationformat

When using DurationFormat.format method, my UI is blocked for few seconds, preventing user from navigating away from the screen

Reproducible Steps/Repo

Steps to reproduce the behavior:

import {DurationFormat} from '@formatjs/intl-durationformat';
const formatter =  new DurationFormat(I18n.locale, options);
return formatter.format({seconds: 232324453463465});

Expected behavior

I don't expect this method to take so much time and resources

Desktop (please complete the following information):

  • OS: MacOS Sonoma 14.1
  • Browser Chrome

Smartphone (please complete the following information):

  • Device: Samsung S22
  • OS: Android 14

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.