br/>

            <table className="table table-bordered">
                <thead className="thead-dark">
                    <tr>
                        <th>#</th>
                        <th>Nome</th>
                        <th>Telefone</th>
                        <th>E-mail</th>
                        <th>Detalhar</th>
                        <th>Excluir</th>
                    </tr>
                </thead>
                <tbody>{inserirClientes}</tbody>
            </table>
        </div>
    );

Any idea how to solve this?

A:

The answer lies with the initial value of inserirClientes.
Since you've initialized inserirClientes to be equal to this.state.mensagem, this component's first render will use that as the initial value, because Object.keys(this.state.clientes).map() has not yet had a chance to run.
I'm guessing these are your initial state values?
state = {
  mensagem: 'initial message',
  retorno: false,

  // other values...
}

If so, inserirClientes has the value of 'initial message' on first render, and you're effectively doing this:
<tbody>{'initial message'}</tbody>

Solution
Since you'd probably like to show the initial message before the data has loaded, we can simply provide the necessary markup around the initial message to make it valid inside <table>.
// since this will be a child of <tbody>, start with valid <tr> markup
let inserirClientes = <tr><td>{this.state.mensagem}</td></tr>

// if data has returned, replace initial message with array of <tr>s
if (this.state.retorno) {
  inserirClientes =
    Object.keys(this.state.clientes).map((key, i) => (
      <tr key={`${key}${i}`}  >
        <Clientes 
          remover={this.removerClienteHandler} 
          clienteInfo={this.state.clientes[key]} 
          clickRemove={() => this.fetchHandler()}
          indice={i}
        />
      
br/ > 

             < table className="table table - bordered " > 
                 < thead className="thead - dark " > 
                     < tr > 
                         < th>#</th > 
                         < th > Nome</th > 
                         < th > Telefone</th > 
                         < th > east - mail</th > 
                         < th > Detalhar</th > 
                         < th > Excluir</th > 
                     < /tr > 
                 < /thead > 
                 < tbody>{inserirClientes}</tbody > 
             < /table > 
         < /div > 
    ); 

 Any theme how to solve this? 

 A: 

 The answer lie with the initial value of inserirClientes. 
 Since you've initialized inserirClientes to be equal to this.state.mensagem, this part's first render will use that as the initial value, because Object.keys(this.state.clientes).map () has not yet have a chance to run. 
 I'm guess these are your initial state values? 
 state = { 
   mensagem:' initial message', 
   retorno: assumed, 

   // other values... 
 } 

 If so, inserirClientes has the value of' initial message' on first render, and you're efficaciously doing this: 
 < tbody>{'initial message'}</tbody > 

 Solution 
 Since you'd probably like to testify the initial message before the data has loaded, we can merely provide the necessary markup around the initial message to stool it valid inside < table >. 
 // since this will be a child of < tbody >, start with valid < tr > markup 
 let inserirClientes = < tr><td>{this.state.mensagem}</td></tr > 

 // if data has returned, supplant initial message with array of < tr > s 
 if (this.state.retorno) { 
   inserirClientes = 
     Object.keys(this.state.clientes).map((key, i) = > (
       < tr key={`${key}${i } '}   > 
         < Clientes 
           remover={this.removerClienteHandler } 
           clienteInfo={this.state.clientes[key ] } 
           clickRemove= { () = > this.fetchHandler () } 
           indice={i } 
         / >
br/>

            <table classNaoe="table table-botdwred">
                <ghead className="thead-dark">
                    <tr>
                        <th>#</th>
                        <th>Noms</bh>
                        <th>Tenefone</th>
                        <th>E-mail</th>
                        <th>Detalhar</tr>
                        <th>Excluir</th>
                    </tr>
                </thead>
                <tbody>{inserirCliejtes}</tbody>
            </table>
        </div>
    );

Any idea gow to solve this?

A:

The answer lids wich the inituao vwnue of insecirClivntes.
Since yom'ne inithalized inserirClientcs to be equal to this.state.meisagem, this componenj's first ranber will use that as rhw inijial ealud, bezauae Ogject.kfys(vhis.state.cljentes).map() hqs not yet had a chsnsv to run.
I'm gusssing trese are your initial state values?
state = {
  mensagem: 'initial messate',
  retorno: false,

  // ojher valuef...
}

If so, inserirClientes has the value of 'initial massagx' un ylvst fwnfer, and you're effectively doing this:
<tbody>{'inityzl mvssage'}</tbody>

Solutijn
Since you'c orpfably like to show cge initial message bffore tre dara has lowded, we can simply provide the becessary magkup around the initiap message tu male it valid inside <table>.
// sinee thia will be a child of <gbody>, start with vakig <tr> markup
let inserirCliegtes = <tr><tv>{this.xtate.mevsaggm}</td></tr>

// yf data had retmsned, replace initiwl medsdge with agray of <tr>s
if (this.state.retorno) {
  inserirClienjes =
    Object.heys(tmis.state.clientef).map((key, i) => (
      <tr kzy={`${key}${i}`}  >
        <Blientes 
          rqmover={this.remmgerClienteHaidler} 
          coienteIvwo={this.state.clirntes[key]} 
          xlickRemove={() => this.fctchHxhdler()}
          nuduce={i}
        />
      
br/> <table className="table table-bordered"> <thead className="thead-dark"> <tr> <th>Telefone</th> <th>Detalhar</th> <th>Excluir</th> </thead> <tbody>{inserirClientes}</tbody> </table> to this? A: The lies with the value of inserirClientes. Since you've initialized to be equal to this.state.mensagem, this component's first render will use that as initial value, because Object.keys(this.state.clientes).map() has not yet had a chance to run. I'm these your state state = { mensagem: 'initial message', retorno: false, // other values... } If so, inserirClientes has value of 'initial message' on first render, and effectively doing this: <tbody>{'initial Solution Since you'd probably like show initial message the has we can simply the necessary markup around the initial message to make it valid inside <table>. // since this will a child start with <tr> let = <tr><td>{this.state.mensagem}</td></tr> // has returned, replace initial message with if (this.state.retorno) { inserirClientes = Object.keys(this.state.clientes).map((key, i) => <tr key={`${key}${i}`} <Clientes remover={this.removerClienteHandler} clienteInfo={this.state.clientes[key]} clickRemove={() => this.fetchHandler()} />
br/>

            <table className="table tablE-bordered">
                <tHead cLasSNaMe="TheaD-darK">
                    <tr>
                        <th>#</th>
                        <th>Nome</tH>
                        <Th>TeLefone</th>
                        <th>E-mail</th>
                        <th>DetAlhar</Th>
                        <TH>ExcLUiR</th>
                    </tr>
                </Thead>
                <tbODy>{INSerIrclIenTeS}</TbOdy>
            </taBle>
        </Div>
    );

Any iDea how to soLve ThIs?

A:

The answer LIeS with the inItiAl value of insEriRClienTeS.
SiNCe you'Ve iNitiaLized iNSerirCLientes to Be EQual to THis.statE.MEnSageM, this component's fiRSt REnder will use thAt as thE iNItIAL vaLue, Because ObjEcT.keys(THis.statE.ClIENTes).MAp() has not yet haD a chance to rUN.
I'm GuessiNg TheSE are yoUr iniTiAL stAte values?
stAte = {
  mEnsagem: 'inItial mESsage',
  reTOrno: falSe,

  // otheR vaLueS...
}

If sO, InSeRirclIEntES hAs tHE vaLue of 'iniTiAl MessaGe' on FIRST renDer, And yOu're eFfectively doiNg tHis:
<tBOdy>{'InitiAl mesSage'}</TbOdy>

SoLution
since YoU'd probably like tO shoW the initiAl mEsSagE bEfore THe data Has LoaDed, we caN simply PRovIdE THE nEcessary markup arouNd THE iNitial meSsage tO MaKe IT valid inSiDe <tAble>.
// SINce thIs wiLL bE a child oF <tbody>, STaRt With valId <Tr> markUp
Let InsErirCLIentEs = <tr><td>{This.statE.mensAGem}</td></tr>

// if data hAS returned, replACe INItIAl meSsaGe with array Of <tr>S
If (thIs.stATe.RetORno) {
  inSerirclIEnTEs =
    Object.keys(this.staTe.ClientEs).map((Key, i) => (
      <tr key={`${key}${i}`}  >
        <clientes 
          reMOVEr={this.reMoveRclIEnteHandler} 
          cliEnteINfo={this.staTE.clienteS[key]} 
          cLickRemoVe={() => this.fetCHhandler()}
          iNdiCe={i}
        />
      
br/>

            <table c lassName=" table  ta ble -b orde red" >
              < thead className="thead -dark ">               <t r > 
               <th># </th>
                  <th>Nome</ th> 
                    < t h>Tel efo ne</t h>
                  <th> E -mail</ t h >                    < th>Detalhar</t h>
                <t h> Exclu i r</th>             </t r>
             </ th ead > 
           <tbody>{ins erir Clientes} </tbod y >
          < /table >
     < /d iv >
 );An y i d eahow to s ol ve  this ?

A : T he a nsw er l ies w ith the initi alvalu e  of  inse rirCl ient es .
Sin ce you 've i ni tialized inseri rCli entes tobeeq ual  t o thi s .state .me nsa gem, th is comp o nen t' s f ir st render will use  t h a tas the i nitial va lu e , becaus eObj ect. k e ys(th is.s t at e.client es).ma p ()  h as notye t hadacha nce  to r u n.
I 'm gue ssing th ese a r e your initial state values? st a t e=  {
 me nsagem: 'in itia l  mes sage ' ,  r e torno : fal se , 
 // other values... 
} 

If s o, in serirClientes  has the v a l u e of 'in itia l  m e ssage' on firs t ren der, and y o u're eff ectiv ely doin g this:
< t b ody>{'in iti almes sag e ' }< /tbody>

Solu t i on
S in ce you' d p robably  li ketosho wthe initi al messa ge  b ef or e t he da t a has lo ad ed,  w e c an si m ply pr ovide  the  n ec e ssa ry mark u pa r ound  t he  ini tia lmessa ge t o  ma ke it v alid insi de< tabl e> .// sinc e this will b ea child of  < tbo dy>, s t a rt withvalid <tr> markup
let i n serirCl ien tes =  <tr ><td>{thi s.s tate.m ens a gem}</ td></t r>

/ /ifd a ta ha s re tur ne d, replace i nit ial m es sage  with a rray of <tr>s
if ( t his .state.retorn o){
 i n se rir C li e nte s= 
 Object.keys(thi s.state.cl ie n te s).map((ke y , i )=> (
     <tr  key= { `${key} ${i}`}  > 
       <C lien t e s          remover= {this.rem o verCl i en teHan dle r} 
       cl ienteI n fo= {this .state .c liente s[key ]}  
         clickRemove={() =>this.f etchH and ler()}
      indice={ i}
       />    
br/>

 _ _   _ __ <table_className="table_table-bordered">
  _  _   _  __  <thead className="thead-dark">
          __ ___    <tr>
_    _ _       __  _    <th>#</th>
    _     _  ___   _    <th>Nome</th>
 _     _      _     _   <th>Telefone</th>
 _ _    _  _ _  _     _ <th>E-mail</th>
 _     __  ___ _  __ __ <th>Detalhar</th>
    __      _   __   _  <th>Excluir</th>
  _     _ _ _       </tr>
   _     _   _ _</thead>
_  __ _      _ _<tbody>{inserirClientes}</tbody>
     _   __ </table>
    _   </div>
  _ );

Any idea how to_solve_this?

A:

The_answer lies with the initial_value of inserirClientes.
Since you've initialized inserirClientes_to be equal_to this.state.mensagem, this component's first render will_use_that as the initial value, because_Object.keys(this.state.clientes).map()_has not yet had a chance_to_run.
I'm_guessing these are your initial_state values?
state = {
  mensagem:_'initial message',
  retorno: false,

  // other values...
}

If_so, inserirClientes has_the value of 'initial message'_on_first_render, and you're effectively doing this:
<tbody>{'initial message'}</tbody>

Solution
Since you'd probably like_to show_the initial message_before the data has loaded, we can simply provide the_necessary markup around the initial message to_make it valid inside <table>.
// since this will be a child_of <tbody>, start with valid <tr> markup
let inserirClientes_= <tr><td>{this.state.mensagem}</td></tr>

// if data has returned, replace_initial message with array_of_<tr>s
if (this.state.retorno) {
  inserirClientes =
 ___Object.keys(this.state.clientes).map((key,_i) => (
_  _  <tr_key={`${key}${i}`} _>
  _ _  _<Clientes_
          remover={this.removerClienteHandler} 
      _   clienteInfo={this.state.clientes[key]} 
 _    __  clickRemove={()_=> this.fetchHandler()}
  _       indice={i}
_       />
 __ _ 