From 107f2f997ebddf53009d4a0b29df6a017ebbf35d Mon Sep 17 00:00:00 2001 From: Fabrizio Cucci Date: Thu, 1 Feb 2024 11:56:57 -0800 Subject: [PATCH] Align ActivityIndicator JSDoc to website doc (#42789) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/42789 I stumbled upon the JSDoc in the [ActivityIndicator](https://fburl.com/code/aq8ljc86) component and noticed a discrepancy wrt our [website](https://reactnative.dev/docs/activityindicator). So I looked more and found out that the doc is not really generated from the code (even though there is a confusing `generate-docs`) but actually lives in the react-native-website [codebase](https://github.com/facebook/react-native-website/blob/994cab25b63d4bed57cedfba95f0133537d42ac7/docs/activityindicator.md?plain=1#L6). Here I'm just aligning the JSDoc to the source of truth (i.e. react-native-website) but this begs the question on whether there is any value in keeping both. Changelog: [Internal] Reviewed By: lunaleaps Differential Revision: D53307738 fbshipit-source-id: b01691460714687f35f875ec51c310333b667fc8 --- .../ActivityIndicator/ActivityIndicator.js | 49 ++++--------------- 1 file changed, 9 insertions(+), 40 deletions(-) diff --git a/packages/react-native/Libraries/Components/ActivityIndicator/ActivityIndicator.js b/packages/react-native/Libraries/Components/ActivityIndicator/ActivityIndicator.js index 655d13d67ce..7f724524add 100644 --- a/packages/react-native/Libraries/Components/ActivityIndicator/ActivityIndicator.js +++ b/packages/react-native/Libraries/Components/ActivityIndicator/ActivityIndicator.js @@ -6,7 +6,6 @@ * * @format * @flow - * @generate-docs */ 'use strict'; @@ -125,9 +124,9 @@ const ActivityIndicator = ( /** Displays a circular loading indicator. - ```SnackPlayer name=ActivityIndicator%20Function%20Component%20Example - import React from "react"; - import { ActivityIndicator, StyleSheet, Text, View } from "react-native"; + ```SnackPlayer name=ActivityIndicator%20Example + import React from 'react'; + import {ActivityIndicator, StyleSheet, View} from 'react-native'; const App = () => ( @@ -141,47 +140,17 @@ const ActivityIndicator = ( const styles = StyleSheet.create({ container: { flex: 1, - justifyContent: "center" + justifyContent: 'center', }, horizontal: { - flexDirection: "row", - justifyContent: "space-around", - padding: 10 - } - }); - export default App; - ``` - - ```SnackPlayer name=ActivityIndicator%20Class%20Component%20Example - import React, { Component } from "react"; - import { ActivityIndicator, StyleSheet, Text, View } from "react-native"; - - class App extends Component { - render() { - return ( - - - - - - - ); - } - } - - const styles = StyleSheet.create({ - container: { - flex: 1, - justifyContent: "center" + flexDirection: 'row', + justifyContent: 'space-around', + padding: 10, }, - horizontal: { - flexDirection: "row", - justifyContent: "space-around", - padding: 10 - } }); + export default App; - ``` +``` */ const ActivityIndicatorWithRef: React.AbstractComponent<