JavaScript React is rendering [Object object] instead of JSX elements inside the array react rendering object object

I have this array of buttons in my React application:

const buttons = [    
<Button label='Close' onClick={props.handleClose} />,
<Button label='Save' onClick={props.handleSubmit} />,
<Button label='Reset' onClick={props.handleReset} />
]

But when I render them:

render() {
    return (
        <div className='buttons'>{buttons.join()}</div>
    )
}

I get:

 Object object Object object Object object

And I want to get those elements.

Answer:1

There is no need to use .join(). It's enough to just pass an array like that:

render() {
    return (
        <div className='buttons'>{buttons}</div>
    )
}
Answer:2

const dt = DateTime.fromISO(new Date(date)) // dt => DateTime {ts: 1516876197386, zone: LocalZone, loc: Locale, invalid: "unparsable", weekData: null, …} return dt.toFormat('yyyy/mm/dd') The ...

const dt = DateTime.fromISO(new Date(date)) // dt => DateTime {ts: 1516876197386, zone: LocalZone, loc: Locale, invalid: "unparsable", weekData: null, …} return dt.toFormat('yyyy/mm/dd') The ...

  1. that in spain
  2. that in spanish
  3. that is
  4. that is very much adequate
  5. that is correct
  6. that is correct gif
  7. that is not my job
  8. that is who you are
  9. that in french
  10. that i may know him
  11. that is in latin
  12. that is not correct vine
  13. that is to say
  14. that is the question
  15. that in spain crossword clue
  16. that is correct meme
  17. that in asl
  18. that in chinese
  19. that is synonym
  20. that i miss you lyrics

Is there a way I can detect an invalid timezone with momentjs? If I do this: const m = moment.tz("01/01/2019 5:30pm", "MM/DD/YYYY h:mma", true, "invalid timezone"); m.isValid(); //true Is there any ...

Is there a way I can detect an invalid timezone with momentjs? If I do this: const m = moment.tz("01/01/2019 5:30pm", "MM/DD/YYYY h:mma", true, "invalid timezone"); m.isValid(); //true Is there any ...

I currently have a list of checkboxes in my webapp. I want to show the order in which the checkboxes have been checked. So I wrote the code below. $scope.updateNumbers = function(id, checked, inputs) ...

I currently have a list of checkboxes in my webapp. I want to show the order in which the checkboxes have been checked. So I wrote the code below. $scope.updateNumbers = function(id, checked, inputs) ...

So I have this: const Link = styled.a` color: blue; `; <Wrapper> <Link href="/">Hover Change</Link> <Wrapper> I want to put a hover effect on just the Link element ...

So I have this: const Link = styled.a` color: blue; `; <Wrapper> <Link href="/">Hover Change</Link> <Wrapper> I want to put a hover effect on just the Link element ...

  1. hover styled component
  2. hover state styled components
  3. button hover styled components
  4. styled component hover parent
  5. styled component hover react
  6. styled component hover effect
  7. hover styled components