Skip to content

Commit d09358d

Browse files
authored
convert all blockquotes to admonitions in unversioned docs (#4784)
1 parent 8e1564c commit d09358d

17 files changed

+212
-108
lines changed

docs/_getting-started-linux-android.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ Setting up your development environment can be somewhat tedious if you're new to
2626

2727
Then, click "Next" to install all of these components.
2828

29-
> If the checkboxes are grayed out, you will have a chance to install these components later on.
29+
:::note
30+
If the checkboxes are grayed out, you will have a chance to install these components later on.
31+
:::
3032

3133
Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.
3234

@@ -36,7 +38,9 @@ Android Studio installs the latest Android SDK by default. Building a React Nati
3638

3739
To do that, open Android Studio, click on "Configure" button and select "SDK Manager".
3840

39-
> The SDK Manager can also be found within the Android Studio "Settings" dialog, under **Languages & Frameworks****Android SDK**.
41+
:::tip
42+
The SDK Manager can also be found within the Android Studio "Settings" dialog, under **Languages & Frameworks****Android SDK**.
43+
:::
4044

4145
Select the "SDK Platforms" tab from within the SDK Manager, then check the box next to "Show Package Details" in the bottom right corner. Look for and expand the `Android 15 (VanillaIceCream)` entry, then make sure the following items are checked:
4246

@@ -59,17 +63,23 @@ export PATH=$PATH:$ANDROID_HOME/emulator
5963
export PATH=$PATH:$ANDROID_HOME/platform-tools
6064
```
6165

62-
> `.bash_profile` is specific to `bash`. If you're using another shell, you will need to edit the appropriate shell-specific config file.
66+
:::note
67+
`.bash_profile` is specific to `bash`. If you're using another shell, you will need to edit the appropriate shell-specific config file.
68+
:::
6369

6470
Type `source $HOME/.bash_profile` for `bash` or `source $HOME/.zprofile` to load the config into your current shell. Verify that ANDROID_HOME has been set by running `echo $ANDROID_HOME` and the appropriate directories have been added to your path by running `echo $PATH`.
6571

66-
> Please make sure you use the correct Android SDK path. You can find the actual location of the SDK in the Android Studio "Settings" dialog, under **Languages & Frameworks****Android SDK**.
72+
:::note
73+
Please make sure you use the correct Android SDK path. You can find the actual location of the SDK in the Android Studio "Settings" dialog, under **Languages & Frameworks****Android SDK**.
74+
:::
6775

6876
<h3>Watchman</h3>
6977

7078
Follow the [Watchman installation guide](https://facebook.github.io/watchman/docs/install#buildinstall) to compile and install Watchman from source.
7179

72-
> [Watchman](https://facebook.github.io/watchman/docs/install) is a tool by Facebook for watching changes in the filesystem. It is highly recommended you install it for better performance and increased compatibility in certain edge cases (translation: you may be able to get by without installing this, but your mileage may vary; installing this now may save you from a headache later).
80+
:::info
81+
[Watchman](https://facebook.github.io/watchman/docs/install) is a tool by Facebook for watching changes in the filesystem. It is highly recommended you install it for better performance and increased compatibility in certain edge cases (translation: you may be able to get by without installing this, but your mileage may vary; installing this now may save you from a headache later).
82+
:::
7383

7484
<h2>Preparing the Android device</h2>
7585

@@ -89,7 +99,9 @@ If you use Android Studio to open `./AwesomeProject/android`, you can see the li
8999

90100
If you have recently installed Android Studio, you will likely need to [create a new AVD](https://developer.android.com/studio/run/managing-avds.html). Select "Create Virtual Device...", then pick any Phone from the list and click "Next", then select the **VanillaIceCream** API Level 35 image.
91101

92-
> We recommend configuring [VM acceleration](https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux) on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.
102+
:::tip
103+
We recommend configuring [VM acceleration](https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux) on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.
104+
:::
93105

94106
Click "Next" then "Finish" to create your AVD. At this point you should be able to click on the green triangle button next to your AVD to launch it.
95107

docs/_getting-started-macos-android.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ Setting up your development environment can be somewhat tedious if you're new to
6565

6666
Then, click "Next" to install all of these components.
6767

68-
> If the checkboxes are grayed out, you will have a chance to install these components later on.
68+
::note
69+
If the checkboxes are grayed out, you will have a chance to install these components later on.
70+
:::
6971

7072
Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.
7173

@@ -77,7 +79,9 @@ To do that, open Android Studio, click on "More Actions" button and select "SDK
7779

7880
![Android Studio Welcome](/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png)
7981

80-
> The SDK Manager can also be found within the Android Studio "Settings" dialog, under **Languages & Frameworks****Android SDK**.
82+
:::tip
83+
The SDK Manager can also be found within the Android Studio "Settings" dialog, under **Languages & Frameworks****Android SDK**.
84+
:::
8185

8286
Select the "SDK Platforms" tab from within the SDK Manager, then check the box next to "Show Package Details" in the bottom right corner. Look for and expand the `Android 15 (VanillaIceCream)` entry, then make sure the following items are checked:
8387

@@ -102,7 +106,9 @@ export PATH=$PATH:$ANDROID_HOME/platform-tools
102106

103107
Run `source ~/.zprofile` (or `source ~/.bash_profile` for `bash`) to load the config into your current shell. Verify that ANDROID_HOME has been set by running `echo $ANDROID_HOME` and the appropriate directories have been added to your path by running `echo $PATH`.
104108

105-
> Please make sure you use the correct Android SDK path. You can find the actual location of the SDK in the Android Studio "Settings" dialog, under **Languages & Frameworks****Android SDK**.
109+
:::note
110+
Please make sure you use the correct Android SDK path. You can find the actual location of the SDK in the Android Studio "Settings" dialog, under **Languages & Frameworks****Android SDK**.
111+
:::
106112

107113
<h2>Preparing the Android device</h2>
108114

docs/_getting-started-windows-android.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@ choco install -y nodejs-lts microsoft-openjdk17
2020

2121
If you have already installed Node on your system, make sure it is Node 18 or newer. If you already have a JDK on your system, we recommend JDK17. You may encounter problems using higher JDK versions.
2222

23-
> You can find additional installation options on [Node's Downloads page](https://nodejs.org/en/download/).
23+
:::note
24+
You can find additional installation options on [Node's Downloads page](https://nodejs.org/en/download/).
25+
:::
2426

25-
> If you're using the latest version of Java Development Kit, you'll need to change the Gradle version of your project so it can recognize the JDK. You can do that by going to `{project root folder}\android\gradle\wrapper\gradle-wrapper.properties` and changing the `distributionUrl` value to upgrade the Gradle version. You can check out [here the latest releases of Gradle](https://gradle.org/releases/).
27+
:::info
28+
If you're using the latest version of Java Development Kit, you'll need to change the Gradle version of your project so it can recognize the JDK. You can do that by going to `{project root folder}\android\gradle\wrapper\gradle-wrapper.properties` and changing the `distributionUrl` value to upgrade the Gradle version. You can check out [here the latest releases of Gradle](https://gradle.org/releases/).
29+
:::
2630

2731
<h3>Android development environment</h3>
2832

@@ -39,7 +43,9 @@ Setting up your development environment can be somewhat tedious if you're new to
3943

4044
Then, click "Next" to install all of these components.
4145

42-
> If the checkboxes are grayed out, you will have a chance to install these components later on.
46+
:::note
47+
If the checkboxes are grayed out, you will have a chance to install these components later on.
48+
:::
4349

4450
Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.
4551

@@ -51,7 +57,9 @@ To do that, open Android Studio, click on "More Actions" button and select "SDK
5157

5258
![Android Studio Welcome](/docs/assets/GettingStartedAndroidStudioWelcomeWindows.png)
5359

54-
> The SDK Manager can also be found within the Android Studio "Settings" dialog, under **Languages & Frameworks****Android SDK**.
60+
:::tip
61+
The SDK Manager can also be found within the Android Studio "Settings" dialog, under **Languages & Frameworks****Android SDK**.
62+
:::
5563

5664
Select the "SDK Platforms" tab from within the SDK Manager, then check the box next to "Show Package Details" in the bottom right corner. Look for and expand the `Android 15 (VanillaIceCream)` entry, then make sure the following items are checked:
5765

@@ -120,7 +128,9 @@ If you use Android Studio to open `./AwesomeProject/android`, you can see the li
120128

121129
If you have recently installed Android Studio, you will likely need to [create a new AVD](https://developer.android.com/studio/run/managing-avds.html). Select "Create Virtual Device...", then pick any Phone from the list and click "Next", then select the **VanillaIceCream** API Level 35 image.
122130

123-
> If you don't have HAXM installed, click on "Install HAXM" or follow [these instructions](https://github.com/intel/haxm/wiki/Installation-Instructions-on-Windows) to set it up, then go back to the AVD Manager.
131+
:::note
132+
If you don't have HAXM installed, click on "Install HAXM" or follow [these instructions](https://github.com/intel/haxm/wiki/Installation-Instructions-on-Windows) to set it up, then go back to the AVD Manager.
133+
:::
124134

125135
Click "Next" then "Finish" to create your AVD. At this point you should be able to click on the green triangle button next to your AVD to launch it.
126136

docs/_remove-global-cli.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
> If you previously installed a global `react-native-cli` package, please remove it as it may cause unexpected issues:
2-
>
3-
> ```shell
4-
> npm uninstall -g react-native-cli @react-native-community/cli
5-
> ```
1+
:::warning
2+
If you previously installed a global `react-native-cli` package, please remove it as it may cause unexpected issues:
3+
4+
```shell
5+
npm uninstall -g react-native-cli @react-native-community/cli
6+
```
7+
8+
:::

docs/flatlist.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,9 @@ Set this true while waiting for new data from a refresh.
640640

641641
This may improve scroll performance for large lists. On Android the default value is `true`.
642642

643-
> Note: May have bugs (missing content) in some circumstances - use at your own risk.
643+
:::warning
644+
May have bugs (missing content) in some circumstances - use at your own risk.
645+
:::
644646

645647
| Type |
646648
| ------- |
@@ -787,7 +789,9 @@ scrollToIndex: (params: {
787789

788790
Scrolls to the item at the specified index such that it is positioned in the viewable area such that `viewPosition` 0 places it at the top, 1 at the bottom, and 0.5 centered in the middle.
789791

790-
> Note: Cannot scroll to locations outside the render window without specifying the `getItemLayout` prop.
792+
:::note
793+
Cannot scroll to locations outside the render window without specifying the `getItemLayout` prop.
794+
:::
791795

792796
**Parameters:**
793797

@@ -816,7 +820,9 @@ scrollToItem(params: {
816820

817821
Requires linear scan through data - use `scrollToIndex` instead if possible.
818822

819-
> Note: Cannot scroll to locations outside the render window without specifying the `getItemLayout` prop.
823+
:::note
824+
Cannot scroll to locations outside the render window without specifying the `getItemLayout` prop.
825+
:::
820826

821827
**Parameters:**
822828

docs/legacy/native-modules-android.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,11 @@ class CalendarModule(reactContext: ReactApplicationContext) : ReactContextBaseJa
7777

7878
As you can see, your `CalendarModule` class extends the `ReactContextBaseJavaModule` class. For Android, Java/Kotlin native modules are written as classes that extend `ReactContextBaseJavaModule` and implement the functionality required by JavaScript.
7979

80-
> It is worth noting that technically Java/Kotlin classes only need to extend the `BaseJavaModule` class or implement the `NativeModule` interface to be considered a Native Module by React Native.
80+
:::note
81+
It is worth noting that technically Java/Kotlin classes only need to extend the `BaseJavaModule` class or implement the `NativeModule` interface to be considered a Native Module by React Native.
8182

82-
> However we recommend that you use `ReactContextBaseJavaModule`, as shown above. `ReactContextBaseJavaModule` gives access to the `ReactApplicationContext` (RAC), which is useful for Native Modules that need to hook into activity lifecycle methods. Using `ReactContextBaseJavaModule` will also make it easier to make your native module type-safe in the future. For native module type-safety, which is coming in future releases, React Native looks at each native module's JavaScript spec and generates an abstract base class that extends `ReactContextBaseJavaModule`.
83+
However we recommend that you use `ReactContextBaseJavaModule`, as shown above. `ReactContextBaseJavaModule` gives access to the `ReactApplicationContext` (RAC), which is useful for Native Modules that need to hook into activity lifecycle methods. Using `ReactContextBaseJavaModule` will also make it easier to make your native module type-safe in the future. For native module type-safety, which is coming in future releases, React Native looks at each native module's JavaScript spec and generates an abstract base class that extends `ReactContextBaseJavaModule`.
84+
:::
8385

8486
### Module Name
8587

@@ -267,7 +269,9 @@ class MyAppPackage : ReactPackage {
267269

268270
This file imports the native module you created, `CalendarModule`. It then instantiates `CalendarModule` within the `createNativeModules()` function and returns it as a list of `NativeModules` to register. If you add more native modules down the line, you can also instantiate them and add them to the list returned here.
269271

270-
> It is worth noting that this way of registering native modules eagerly initializes all native modules when the application starts, which adds to the startup time of an application. You can use [TurboReactPackage](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/TurboReactPackage.java) as an alternative. Instead of `createNativeModules`, which return a list of instantiated native module objects, TurboReactPackage implements a `getModule(String name, ReactApplicationContext rac)` method that creates the native module object, when required. TurboReactPackage is a bit more complicated to implement at the moment. In addition to implementing a `getModule()` method, you have to implement a `getReactModuleInfoProvider()` method, which returns a list of all the native modules the package can instantiate along with a function that instantiates them, example [here](https://github.com/facebook/react-native/blob/8ac467c51b94c82d81930b4802b2978c85539925/ReactAndroid/src/main/java/com/facebook/react/CoreModulesPackage.java#L86-L165). Again, using TurboReactPackage will allow your application to have a faster startup time, but it is currently a bit cumbersome to write. So proceed with caution if you choose to use TurboReactPackages.
272+
:::note
273+
It is worth noting that this way of registering native modules eagerly initializes all native modules when the application starts, which adds to the startup time of an application. You can use [TurboReactPackage](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/TurboReactPackage.java) as an alternative. Instead of `createNativeModules`, which return a list of instantiated native module objects, TurboReactPackage implements a `getModule(String name, ReactApplicationContext rac)` method that creates the native module object, when required. TurboReactPackage is a bit more complicated to implement at the moment. In addition to implementing a `getModule()` method, you have to implement a `getReactModuleInfoProvider()` method, which returns a list of all the native modules the package can instantiate along with a function that instantiates them, example [here](https://github.com/facebook/react-native/blob/8ac467c51b94c82d81930b4802b2978c85539925/ReactAndroid/src/main/java/com/facebook/react/CoreModulesPackage.java#L86-L165). Again, using TurboReactPackage will allow your application to have a faster startup time, but it is currently a bit cumbersome to write. So proceed with caution if you choose to use TurboReactPackages.
274+
:::
271275

272276
To register the `CalendarModule` package, you must add `MyAppPackage` to the list of packages returned in ReactNativeHost's `getPackages()` method. Open up your `MainApplication.java` or `MainApplication.kt` file, which can be found in the following path: `android/app/src/main/java/com/your-app-name/`.
273277

@@ -431,7 +435,9 @@ import CalendarModule from './CalendarModule';
431435
CalendarModule.createCalendarEvent('foo', 'bar');
432436
```
433437

434-
> This assumes that the place you are importing `CalendarModule` is in the same hierarchy as `CalendarModule.js`. Please update the relative import as necessary.
438+
:::note
439+
This assumes that the place you are importing `CalendarModule` is in the same hierarchy as `CalendarModule.js`. Please update the relative import as necessary.
440+
:::
435441

436442
### Argument Types
437443

@@ -449,12 +455,14 @@ When a native module method is invoked in JavaScript, React Native converts the
449455
| ReadableMap | ReadableMap | Object |
450456
| ReadableArray | ReadableArray | Array |
451457

452-
> The following types are currently supported but will not be supported in TurboModules. Please avoid using them:
453-
>
454-
> - Integer Java/Kotlin -> ?number
455-
> - Float Java/Kotlin -> ?number
456-
> - int Java -> number
457-
> - float Java -> number
458+
:::info
459+
The following types are currently supported but will not be supported in TurboModules. Please avoid using them:
460+
461+
- Integer Java/Kotlin -> ?number
462+
- Float Java/Kotlin -> ?number
463+
- int Java -> number
464+
- float Java -> number
465+
:::
458466

459467
For argument types not listed above, you will need to handle the conversion yourself. For example, in Android, `Date` conversion is not supported out of the box. You can handle the conversion to the `Date` type within the native method yourself like so:
460468

@@ -524,7 +532,9 @@ console.log(DEFAULT_EVENT_NAME);
524532

525533
Technically it is possible to access constants exported in `getConstants()` directly off the native module object. This will no longer be supported with TurboModules, so we encourage the community to switch to the above approach to avoid necessary migration down the line.
526534

527-
> That currently constants are exported only at initialization time, so if you change getConstants values at runtime it won't affect the JavaScript environment. This will change with Turbomodules. With Turbomodules, `getConstants()` will become a regular native module method, and each invocation will hit the native side.
535+
:::note
536+
That currently constants are exported only at initialization time, so if you change getConstants values at runtime it won't affect the JavaScript environment. This will change with Turbomodules. With Turbomodules, `getConstants()` will become a regular native module method, and each invocation will hit the native side.
537+
:::
528538

529539
### Callbacks
530540

@@ -729,7 +739,9 @@ fun createCalendarEvent(name: String, location: String, promise: Promise) {
729739
</TabItem>
730740
</Tabs>
731741

732-
> Similar to callbacks, a native module method can either reject or resolve a promise (but not both) and can do so at most once. This means that you can either call a success callback or a failure callback, but not both, and each callback can only be invoked at most one time. A native module can, however, store the callback and invoke it later.
742+
:::note
743+
Similar to callbacks, a native module method can either reject or resolve a promise (but not both) and can do so at most once. This means that you can either call a success callback or a failure callback, but not both, and each callback can only be invoked at most one time. A native module can, however, store the callback and invoke it later.
744+
:::
733745

734746
The JavaScript counterpart of this method returns a Promise. This means you can use the `await` keyword within an async function to call it and wait for its result:
735747

0 commit comments

Comments
 (0)