Skip to content

Commit 94cd833

Browse files
authored
Merge branch 'main' into slorber/docusaurus-3.7
2 parents f813793 + 9cda4c9 commit 94cd833

5 files changed

Lines changed: 55 additions & 32 deletions

File tree

docs/linking.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,15 @@ If your app is using [Universal Links](https://developer.apple.com/ios/universal
8484
<TabItem value="swift">
8585
8686
```swift title="AppDelegate.swift"
87-
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
87+
override func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
8888
return RCTLinkingManager.application(app, open: url, options: options)
8989
}
9090
```
9191

9292
If your app is using [Universal Links](https://developer.apple.com/ios/universal-links/), you'll need to add the following code as well:
9393

9494
```swift title="AppDelegate.swift"
95-
func application(
95+
override func application(
9696
_ application: UIApplication,
9797
continue userActivity: NSUserActivity,
9898
restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {

docs/typescript.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ npx create-expo-app --template
2525
<TabItem value="npm">
2626

2727
```shell
28-
npm install -D @tsconfig/react-native @types/jest @types/react @types/react-test-renderer typescript
28+
npm install -D typescript @react-native/typescript-config @types/jest @types/react @types/react-test-renderer
2929
```
3030

3131
</TabItem>
3232
<TabItem value="yarn">
3333

3434
```shell
35-
yarn add --dev @tsconfig/react-native @types/jest @types/react @types/react-test-renderer typescript
35+
yarn add --dev typescript @react-native/typescript-config @types/jest @types/react @types/react-test-renderer
3636
```
3737

3838
</TabItem>
@@ -44,9 +44,9 @@ This command adds the latest version of every dependency. The versions may need
4444

4545
2. Add a TypeScript config file. Create a `tsconfig.json` in the root of your project:
4646

47-
```json
47+
```json title="tsconfig.json"
4848
{
49-
"extends": "@tsconfig/react-native/tsconfig.json"
49+
"extends": "@react-native/typescript-config"
5050
}
5151
```
5252

@@ -86,19 +86,16 @@ Out of the box, TypeScript sources are transformed by [Babel][babel] during bund
8686
You can provide an interface for a React Component's [Props](props) and [State](state) via `React.Component<Props, State>` which will provide type-checking and editor auto-completing when working with that component in JSX.
8787

8888
```tsx title="components/Hello.tsx"
89-
import React from 'react';
89+
import {useState} from 'react';
9090
import {Button, StyleSheet, Text, View} from 'react-native';
9191

9292
export type Props = {
9393
name: string;
9494
baseEnthusiasmLevel?: number;
9595
};
9696

97-
const Hello: React.FC<Props> = ({
98-
name,
99-
baseEnthusiasmLevel = 0,
100-
}) => {
101-
const [enthusiasmLevel, setEnthusiasmLevel] = React.useState(
97+
function Hello({name, baseEnthusiasmLevel = 0}: Props) {
98+
const [enthusiasmLevel, setEnthusiasmLevel] = useState(
10299
baseEnthusiasmLevel,
103100
);
104101

@@ -134,7 +131,7 @@ const Hello: React.FC<Props> = ({
134131
</View>
135132
</View>
136133
);
137-
};
134+
}
138135

139136
const styles = StyleSheet.create({
140137
container: {
@@ -168,8 +165,8 @@ To use custom path aliases with TypeScript, you need to set the path aliases to
168165

169166
```diff
170167
{
171-
- "extends": "@tsconfig/react-native/tsconfig.json"
172-
+ "extends": "@tsconfig/react-native/tsconfig.json",
168+
- "extends": "@react-native/typescript-config"
169+
+ "extends": "@react-native/typescript-config",
173170
+ "compilerOptions": {
174171
+ "baseUrl": ".",
175172
+ "paths": {

website/blog/2025-04-08-react-native-0.79.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,23 @@ This release ships with [Metro 0.82](https://github.com/facebook/metro/releases/
2929

3030
![metro startup comparison](../static/blog/assets/0.79-metro-startup-comparison.gif)
3131

32-
Also in Metro 0.82, we’re promoting `package.json` `exports` and `imports` field resolution to stable. `exports` resolution was [introduced in React Native 0.72](/blog/2023/06/21/package-exports-support), and `imports` support was added in a community contribution - both will now be enabled by default for all the projects on React Native 0.79.
32+
Also in Metro 0.82, we’re promoting `package.json` `"exports"` and `"imports"` field resolution to stable. `"exports"` resolution was [introduced in React Native 0.72](/blog/2023/06/21/package-exports-support), and `"imports"` support was added in a community contribution - both will now be enabled by default for all the projects on React Native 0.79.
3333

3434
This improves compatibility with modern npm dependencies, and opens up new, standards-compliant ways to organise your projects.
3535

36+
:::warning Breaking change
37+
38+
While we've been testing `package.json` `"exports"` in the community for a while, this switchover can be a breaking change for certain packages and project setups.
39+
40+
In particular, we're aware of user reported incompatibilities for some popular packages including Firebase and AWS Amplify, and are working to get these fixed at source.
41+
42+
If you're encountering issues:
43+
44+
- Please update to the Metro [0.81.5 hotfix](https://github.com/facebook/metro/releases/tag/v0.81.5), or set [`resolver.unstable_enablePackageExports = false`](https://metrobundler.dev/docs/configuration/#unstable_enablepackageexports-experimental) to opt out.
45+
- See [expo/expo#36551](https://github.com/expo/expo/discussions/36551) for affected packages and future updates.
46+
47+
:::
48+
3649
### JSC moving to Community Package
3750

3851
As part of our effort to reduce the API surface of React Native, we're in the process of moving the JavaScriptCore (JSC) engine to a community-maintained package: `@react-native-community/javascriptcore`
@@ -150,7 +163,7 @@ This change has a subtle impact on existing imports:
150163

151164
<details>
152165
<summary>**Case 1: Default export**</summary>
153-
166+
154167
```diff
155168
// CHANGED - require() syntax
156169
- const ImageBackground = require('react-native/Libraries/Image/ImageBackground');
@@ -162,7 +175,7 @@ import ImageBackground from 'react-native/Libraries/Image/ImageBackground';
162175
// RECOMMENDED - root import
163176
import {ImageBackground} from 'react-native';
164177

165-
````
178+
```
166179

167180
</details>
168181

@@ -189,7 +202,7 @@ There are very few cases of this pattern, again unaffected when using the root `
189202

190203
// RECOMMENDED - root import
191204
import {BlobRegistry} from 'react-native';
192-
````
205+
```
193206

194207
</details>
195208

website/blog/authors.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,3 +308,19 @@ shubham:
308308
x: https://x.com/sg43245
309309
github: https://github.com/shubhamguptadream11
310310
image_url: https://github.com/shubhamguptadream11.png
311+
312+
hezi:
313+
name: Jorge Cohen
314+
title: Engineering Manager @ Meta
315+
socials:
316+
x: https://x.com/jorgewritescode
317+
github: https://github.com/hezi
318+
image_url: https://github.com/hezi.png
319+
320+
chrfalch:
321+
name: Christian Falch
322+
title: Software Engineer @ Expo
323+
socials:
324+
x: https://x.com/chrfalch
325+
github: https://github.com/chrfalch
326+
image_url: https://github.com/chrfalch.png

website/versioned_docs/version-0.79/typescript.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ npx create-expo-app --template
2525
<TabItem value="npm">
2626

2727
```shell
28-
npm install -D @tsconfig/react-native @types/jest @types/react @types/react-test-renderer typescript
28+
npm install -D typescript @react-native/typescript-config @types/jest @types/react @types/react-test-renderer
2929
```
3030

3131
</TabItem>
3232
<TabItem value="yarn">
3333

3434
```shell
35-
yarn add --dev @tsconfig/react-native @types/jest @types/react @types/react-test-renderer typescript
35+
yarn add --dev typescript @react-native/typescript-config @types/jest @types/react @types/react-test-renderer
3636
```
3737

3838
</TabItem>
@@ -44,9 +44,9 @@ This command adds the latest version of every dependency. The versions may need
4444

4545
2. Add a TypeScript config file. Create a `tsconfig.json` in the root of your project:
4646

47-
```json
47+
```json title="tsconfig.json"
4848
{
49-
"extends": "@tsconfig/react-native/tsconfig.json"
49+
"extends": "@react-native/typescript-config"
5050
}
5151
```
5252

@@ -86,19 +86,16 @@ Out of the box, TypeScript sources are transformed by [Babel][babel] during bund
8686
You can provide an interface for a React Component's [Props](props) and [State](state) via `React.Component<Props, State>` which will provide type-checking and editor auto-completing when working with that component in JSX.
8787

8888
```tsx title="components/Hello.tsx"
89-
import React from 'react';
89+
import {useState} from 'react';
9090
import {Button, StyleSheet, Text, View} from 'react-native';
9191

9292
export type Props = {
9393
name: string;
9494
baseEnthusiasmLevel?: number;
9595
};
9696

97-
const Hello: React.FC<Props> = ({
98-
name,
99-
baseEnthusiasmLevel = 0,
100-
}) => {
101-
const [enthusiasmLevel, setEnthusiasmLevel] = React.useState(
97+
function Hello({name, baseEnthusiasmLevel = 0}: Props) {
98+
const [enthusiasmLevel, setEnthusiasmLevel] = useState(
10299
baseEnthusiasmLevel,
103100
);
104101

@@ -134,7 +131,7 @@ const Hello: React.FC<Props> = ({
134131
</View>
135132
</View>
136133
);
137-
};
134+
}
138135

139136
const styles = StyleSheet.create({
140137
container: {
@@ -168,8 +165,8 @@ To use custom path aliases with TypeScript, you need to set the path aliases to
168165

169166
```diff
170167
{
171-
- "extends": "@tsconfig/react-native/tsconfig.json"
172-
+ "extends": "@tsconfig/react-native/tsconfig.json",
168+
- "extends": "@react-native/typescript-config"
169+
+ "extends": "@react-native/typescript-config",
173170
+ "compilerOptions": {
174171
+ "baseUrl": ".",
175172
+ "paths": {

0 commit comments

Comments
 (0)