Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

461
Vistas
React Native - How to document a component?

How do you comment a React Component?

import React, { useState } from 'react';
import { Text, TextInput, View } from 'react-native';
import PropTypes from "prop-types";

const PizzaTranslator = ({ pizzaEmoji = '🍕'}) => {
  const [text, setText] = useState('');
  return (
    <View style={{padding: 10}}>
      <TextInput
        style={{height: 40}}
        placeholder="Type here to translate!"
        onChangeText={newText => setText(newText)}
        defaultValue={text}
      />
      <Text style={{padding: 10, fontSize: 42}}>
        {text.split(' ').map((word) => word && pizzaEmoji).join(' ')}
      </Text>
    </View>
  );
}

PizzaTranslator.propTypes = {
   pizzaEmoji: PropTypes.string,
}

export default PizzaTranslator;

I am documenting my React Native (EXPO) app's components. For that, I have tried to install

react-styleguidist.js

but, after following all the installation process, I have fallen in multiple errors related with the expo webpack configuration.

Is it recommended to use third-party libraries like react-styleguidist in order to auto-generate visual documentation? Or is it enough to comment them using JSDOC syntax?

What do you recommend me in order to comment my components code? Any library or guide you use?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

React Native Template itself using JSDOC syntax to comment like this

/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * @format
 * @flow strict-local
 */

import React from 'react';
...

So I think it is enough.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda