M
M
Maxim js2020-04-30 14:15:30
React
Maxim js, 2020-04-30 14:15:30

How to add a div next to a REACT component?

I can't add an element ... how can I do it in my case?

import React, {Fragment} from 'react';
import './List-button.scss';


const ListButton = ({items}) => {
  return  <Fragment>
  <button className="todo-header-plus" title="Создать список дел">
    {
      items.map((item,index) => (
        <i key={index}>{item.icon}</i>
      ))
    }
  </button>
  <div>КАК СЮДА ДОБАВИТЬ ДИВ???!!!!!!!!!!<div/>
  <Fragment/>
}


export default ListButton;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2020-04-30
@HistoryART

const ListButton = ({items}) => (<Fragment>
  <button className="todo-header-plus" title="Создать список дел">
    {
      items.map((item,index) => (
        <i key={index}>{item.icon}</i>
      ))
    }
  </button>
  <div>КАК СЮДА ДОБАВИТЬ ДИВ???!!!!!!!!!!<div/>
  <Fragment/>)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question