Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

462
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda