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

141
Visualizações
React Hook is called in function that is neither a React function component nor a custom React Hook function

I have this following ESLint warning :

React Hook "useBuilderFeatureFlagContext" is called in function "Slide.RenderBuilder" that is neither a React function component nor a custom React Hook function.

and this is the following component :

Slide.RenderBuilder = ({ children }) => {
  const flags = useBuilderFeatureFlagContext();

  return (
    <>
      <SlideWrapper $flags={flags}>
        {children}
      </SlideWrapper>
      <ImageSetter attributeName="containerBackgroundImage" />
    </>
  );
};

How do I write a rule that can whitelist this specific case ?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

If you can, define the component first, then add it to your object.

const RenderBuilder = ({ children }) => {
  const flags = useBuilderFeatureFlagContext();

  return (/**/);
};

Slide.RenderBuilder = RenderBuilder;

That way, the rule properly check for hooks, and you have the structure you're looking for.

Make sure to use it as a component <Slide.RenderBuilder /> otherwise you might end up breaking rules of hooks.

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