use-intl 3.23.5 → 3.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -35,7 +35,7 @@ export default function UserProfile({user}) {
35
35
  // en.json
36
36
  {
37
37
  "UserProfile": {
38
- "title": "{username}'s profile",
38
+ "title": "{firstName}'s profile",
39
39
  "membership": "Member since {memberSince, date, short}",
40
40
  "followers": "{count, plural, ↵
41
41
  =0 {No followers yet} ↵
@@ -60,21 +60,21 @@ import {IntlProvider, useTranslations} from 'use-intl';
60
60
  // along with your app once you have the messages.
61
61
  const messages = {
62
62
  App: {
63
- hello: 'Hello {username}!'
63
+ hello: 'Hello {firstName}!'
64
64
  }
65
65
  };
66
66
 
67
67
  function Root() {
68
68
  return (
69
69
  <IntlProvider messages={messages} locale="en">
70
- <App user={{name: 'Jane'}} />
70
+ <App user={{firstName: 'Jane'}} />
71
71
  </IntlProvider>
72
72
  );
73
73
  }
74
74
 
75
75
  function App({user}) {
76
76
  const t = useTranslations('App');
77
- return <h1>{t('hello', {username: user.name})}</h1>;
77
+ return <h1>{t('hello', {firstName: user.firstName})}</h1>;
78
78
  }
79
79
  ```
80
80
 
@@ -4,6 +4,8 @@ export type { default as Formats } from './Formats';
4
4
  export type { default as IntlConfig } from './IntlConfig';
5
5
  export type { default as DateTimeFormatOptions } from './DateTimeFormatOptions';
6
6
  export type { default as NumberFormatOptions } from './NumberFormatOptions';
7
+ export type { default as RelativeTimeFormatOptions } from './RelativeTimeFormatOptions';
8
+ export type { default as Timezone } from './TimeZone';
7
9
  export { default as IntlError, IntlErrorCode } from './IntlError';
8
10
  export { default as createTranslator } from './createTranslator';
9
11
  export { default as createFormatter } from './createFormatter';
@@ -1 +1 @@
1
- export default function useTimeZone(): import("../core/TimeZone").default | undefined;
1
+ export default function useTimeZone(): import("..").Timezone | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "use-intl",
3
- "version": "3.23.5",
3
+ "version": "3.25.0",
4
4
  "sideEffects": false,
5
5
  "author": "Jan Amann <jan@amann.work>",
6
6
  "description": "Internationalization (i18n) for React",
@@ -68,7 +68,7 @@
68
68
  "intl-messageformat": "^10.5.14"
69
69
  },
70
70
  "peerDependencies": {
71
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
71
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0"
72
72
  },
73
- "gitHead": "70023b06a9a4e156d1f239b0722630df3c5527f1"
73
+ "gitHead": "4e3e9151d9b962ec36afcd19e420c49f5b316124"
74
74
  }