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

163
Visualizações
JSDoc - How to document a parameter that is being ignored `function f(_, otherParam) {}`

I have the following code:

const renderRightActions = (_, dragX) => {
  const trans = dragX.interpolate({
    inputRange: [0, 50, 100, 101],
    outputRange: [60, 110, 110, 110],
  });

  return (
    <Animated.View style={{ transform: [{ translateX: trans }] }}>
      <RectButton
        onPress={handleOnDeleteButtonPress}
        style={[
          styles.trashIconContainer,
          {
            backgroundColor: colors.primary,
          },
        ]}
      >
        <Icon
          name="trash-can"
          type="material-community"
          size={26}
          color={colors.white}
        />
      </RectButton>
    </Animated.View>
  );
};

As you can see, I am ignoring the first argument of the method using the underscore character.

How can I document it in JSDoc? I have tried this:

/**
 * Renders the right actions for the `Swipeable`.
 *
 * @param {any} _ - Ignored parameter.
 * @param {Animated.AnimatedInterpolation} dragX - Drag X value.
 * @returns {React.ReactNode} The `Swipeable` right action.
 */

But not sure if there is any standardized way to handle this situation. Any ideas?

about 4 years ago · Juan Pablo Isaza
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