Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

458
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
ยฉ 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!