Code Monkey home page Code Monkey logo

react-sortablejs's Introduction

react-sortablejs

React bindings to SortableJS

semantic-release

Please note that this is not considered ready for production, as there are still a number of bugs being sent through.

Features

Installation

sortablejs and @types/sortablejs are peer dependencies. The latter is only used if intellisense/typescript is desired.

npm install --save react-sortablejs sortablejs
npm install --save-dev @types/sortablejs

# OR
yarn add react-sortablejs sortablejs
yarn add -D @types/sortablejs

Learn

Here is the TLDR of what sortable is:

- Shopping List: # list of items / sortable. This represents `react-sortablejs`
  - eggs # list item. These are all the items in the list and are what you move around.
  - bread # list item
  - milk # list item

Usage/Examples

Function Component

import React, { FC, useState } from "react";
import { ReactSortable } from "react-sortablejs";

interface ItemType {
  id: number;
  name: string;
}

export const BasicFunction: FC = (props) => {
  const [state, setState] = useState<ItemType[]>([
    { id: 1, name: "shrek" },
    { id: 2, name: "fiona" },
  ]);

  return (
    <ReactSortable list={state} setList={setState}>
      {state.map((item) => (
        <div key={item.id}>{item.name}</div>
      ))}
    </ReactSortable>
  );
};

Class Component

import React, { Component } from "react";
import { ReactSortable } from "react-sortablejs";

interface BasicClassState {
  list: { id: string; name: string }[];
}

export class BasicClass extends Component<{}, BasicClassState> {
  state: BasicClassState = {
    list: [{ id: "1", name: "shrek" }],
  };
  render() {
    return (
      <ReactSortable
        list={this.state.list}
        setList={(newState) => this.setState({ list: newState })}
      >
        {this.state.list.map((item) => (
          <div key={item.id}>{item.name}</div>
        ))}
      </ReactSortable>
    );
  }
}

Plugins

Sortable has some pretty cool plugins such as MultiDrag and Swap.

By Default:

  • AutoScroll is premounted and enabled.
  • OnSpill is premounted and NOT enabled.
  • MultiDrag and Swap and NOT premounted and NOT enabled

You must mount the plugin with sortable ONCE ONLY.

import React from "react";
import { ReactSortable, Sortable, MultiDrag, Swap } from "react-sortablejs";

// mount whatever plugins you'd like to. These are the only current options.
Sortable.mount(new MultiDrag(), new Swap());

const App = () => {
  const [state, setState] = useState([
    { id: 1, name: "shrek" },
    { id: 2, name: "fiona" },
  ]);

  return (
    <ReactSortable
      multiDrag // enables mutidrag
      // OR
      swap // enables swap
    >
      {state.map((item) => (
        <div key={item.id}>{item.name}</div>
      ))}
    </ReactSortable>
  );
};

Sortable API

For a comprehensive list of options, please visit https://github.com/SortableJS/Sortable#options.

Those options are applied as follows.

Sortable.create(element, {
  group: " groupName",
  animation: 200,
  delayOnTouchStart: true,
  delay: 2,
});

// --------------------------
// Will now be...
// --------------------------

import React from "react";
import { ReactSortable } from "react-sortablejs";

const App = () => {
  const [state, setState] = useState([
    { id: 1, name: "shrek" },
    { id: 2, name: "fiona" },
  ]);

  return (
    <ReactSortable
      // here they are!
      group="groupName"
      animation={200}
      delayOnTouchStart={true}
      delay={2}
    >
      {state.map((item) => (
        <div key={item.id}>{item.name}</div>
      ))}
    </ReactSortable>
  );
};

React API

id, className, style

These are all default DOM attributes. Nothing special here.

list

The same as state in const [ state, setState] = useState([{ id: 1}, {id: 2}])

state must be an array of items, with each item being an object that has the following shape:

  /** The unique id associated with your item. It's recommended this is the same as the key prop for your list item. */
  id: string | number;
  /** When true, the item is selected using MultiDrag */
  selected?: boolean;
  /** When true, the item is deemed "chosen", which basically just a mousedown event. */
  chosen?: boolean;
  /** When true, it will not be possible to pick this item up in the list. */
  filtered?: boolean;
  [property: string]: any;

setList

The same as setState in const [ state, setState] = useState([{ id: 1}, {id: 2}])

clone

If you're using {group: { name: 'groupName', pull: 'clone'}}, this means you're in 'clone' mode. You should provide a function for this.

Check out the source code of the clone example for more information. I'll write it here soon.

tag

ReactSortable is a div element by default. This can be changed to be any HTML element (for example ul, ol) or can be a React component.

This value, be it the component or the HTML element, should be passed down under props.tag.

Let's explore both here.

HTML Element

Here we will use an ul. You can use any HTML. Just add the string and ReactSortable will use a ul instead of a div.

import React, { FC, useState } from "react";
import { ReactSortable } from "react-sortablejs";

export const BasicFunction: FC = (props) => {
  const [state, setState] = useState([{ id: "1", name: "shrek" }]);

  return (
    <ReactSortable tag="ul" list={state} setList={setState}>
      {state.map((item) => (
        <li key={item.id}>{item.name}</li>
      ))}
    </ReactSortable>
  );
};

Custom Component

When using a custom component in the tag prop, the only component it allows is a forwardRef component. Currently, we only support components that use the React.forwardRef API.

If it doesn't have one, you can add one using React.forwardRef().

todo: Some third-party UI components may have nested elements to create the look they're after. This could be an issue and not sure how to fix it.

import React, { FC, useState, forwardRef } from "react";
import { ReactSortable } from "react-sortablejs";

// This is just like a normal component, but now has a ref.
const CustomComponent = forwardRef<HTMLDivElement, any>((props, ref) => {
  return <div ref={ref}>{props.children}</div>;
});

export const BasicFunction: FC = (props) => {
  const [state, setState] = useState([
    { id: 1, name: "shrek" },
    { id: 2, name: "fiona" },
  ]);

  return (
    <ReactSortable tag={CustomComponent} list={state} setList={setState}>
      {state.map((item) => (
        <div key={item.id}>{item.name}</div>
      ))}
    </ReactSortable>
  );
};

How does it work?

Sortable affects the DOM, adding, and removing nodes/css when it needs to in order to achieve the smooth transitions we all know an love. This component reverses many of its actions of the DOM so React can handle this when the state changes.

Caveats / Gotchas

key !== index

DO NOT use the index as a key for your list items. Sorting will not work.

In all the examples above, I used an object with an ID. You should do the same!

I may even enforce this into the design to eliminate errors.

Nesting

Problem

Basically, the child updates the state twice. I'm working on this.

What does work?

Our usage indicates that as long as we only move items between lists that don't use the same setState function.

I hope to provide an example soon.

Solutions

We don't have anything that works 100%, but here I'd like to spitball some potential avenues to look down.

  • Use onMove to handle state changes instead of onAdd,onRemove, etc.
  • Create a Sortable plugin specifically for react-sortbalejs

react-sortablejs's People

Contributors

andresin87 avatar cangshudada avatar cheton avatar dependabot[bot] avatar dteske25 avatar eljusto avatar ermyril avatar exentrich avatar feketegy avatar herol3oy avatar i-akhmadullin avatar iamjulianacosta avatar jakobsturm avatar kierandotco avatar kjanoudi avatar krnlde avatar leqwasd avatar megawac avatar mohan-bitla avatar msftenhanceprovenance avatar owen-m1 avatar ramen-curator avatar richorama avatar semantic-release-bot avatar shelimov avatar tjramage avatar turnerniles avatar volenarg avatar waynevanson avatar zachiah avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-sortablejs's Issues

Uncaught Error: Cannot call beginDrag while dragging.

Hi,

I get the following error when dragging li items after the first time.
It looks like drop / end doesn't occur? Has anyone got the issue?

I am using the uncontrolled component example from index.jsx, nested into a react-bootstrap modal.

Many thanks!

Doesn't work in new chrome browser

Works fine in old chrome browser, in new version doesn't work. Nothing heppening. Tested it in lots of Laptops and so. Looks like onChange doesn't work

Virtualization

Can this library work with virtualization library, ie. react-virtualized,...

Updating state which contains objects instead of literals

In the examples, we have state specified as an array of strings or numbers.

I have tried to use an array of objects here, something like:

        groupLeft: [{ name: 'Cat', num: 3 }, { name: 'Dog', num: 4 }],
        groupRight: [{ name: 'Mouse', num: 5 }, { name: 'Lion', num: 6 }],

        //...

        const groupLeft = this.state.groupLeft.map((obj, key) => (
            <div key={uniqueId()} data-id={obj.num}>{obj.name}</div>
        ));
        const groupRight = this.state.groupRight.map((obj, key) => (
            <div key={uniqueId()} data-id={obj.num}>{obj.name}</div>

        //...

                                onChange={(items) => {
                                    this.setState({ groupRight: items });
                                }}

Seems like it doesn't work out of the box for objects. Is that true? I'm guessing it works for literals because you can just pass that literal to data-id, and the first parameter of onChange is the order of data-ids?

Would a solution be to pass some kind of id to data-id, and then write some logic in onChange to re-arrange the objects inside of state based on those ids?

I am wondering if logic that does this might belong inside of react-sortable, since you are pretty much always going to be rearranging an array?

Thanks!

(Disclaimer: I am rather new to react and js)

UPDATE:
I was able to manipulate the order of objects in state by adding this:

import { map, find } from 'lodash';

//...

                                onChange={(order) => {
                                    const items = map(order, (num) => find(this.state.groupLeft, (o) => o.num.toString() === num));

                                    this.setState({ groupLeft: items });
                                }}

(would have to be repeated for groupRight)

How to use it on a non node project

Hi Cheton, I'm not a node expert, I'm trying to use your component on a project that isn't a node project but it isn't working with the `import React from 'react' syntax.

Can you tell me how to turn it into a .js file? May I suggest you even add it to the README and the .js file to the src folder? :)

How to use react-sortable with ui frameworks ?

Sortable component allows to define a list with html tag and css class. So if I understand things properly, the following list:

<ul>
  <li>One</li>
  <li>Two</li>
  <li>Three</li>
</ul>

would look somehow like that (just the render part) after making it react-sortable:

<Sortable tag="ul">
  <li key="1">One</li>
  <li key="2">Two</li>
  <li key="3">Three</li>  
</Sortable>

But in my case I pretend to use material-ui, and there a list get defined with a component and not just with a simple tag:

<List>
  <ListItem primaryText="One" />
  <ListItem primaryText="Two"  />
  <ListItem primaryText="Three" />
</List>

how can I make that react-sortable ?

Change list problem

Hi,

I try to put in jsFiddle

First, I drag and drop some items from SortableList1 to empty SortableList2, and then I click button to change Items in SortableList1. After doing that, the dragged item in SortableList1 did not change, and the dropped item in SortableList2 is changed.

I'm not sure what the problem is, does anyone have idea?

Thanks.

Update list after API call

So, not sure if I've implemented this correctly or not. However, I have a sortable list that is provided by state management (Redux). It's a numbered list of items, for example:

1. This is my first item.
2. This is my second item.
3. This is my third item.

I'm using a Controlled Component, in that I build my list from state. When an item is dragged from one position to another I'm using the onChange method to fire off an API call. An example of an updated list might be:

1. This is my second item.
2. This is my third item.
3. This is my first item. 

This updates the list on the backend, and I then update local state. This causes a render to occur, and the list flashes. I'm trying to avoid this, and wondering if I should be approaching state for the list differently?

Server side rendering error

Hello. I am attempting to use your component on a server rendered page. Everything works great except I am seeing the following warning. It is saying there is inconsistent markup. Might you know why this is occurring? Thanks!

React attempted to reuse markup in a container but the checksum was invalid. This generally means that you are using server rendering and the markup generated on the server was not what the client was expecting. React injected new markup to compensate which works but you have lost many of the benefits of server rendering. Instead, figure out why the markup being generated is different on the client or server

Newly rendered DOM elements not sortable

When new items are added or a set of items is replaced via new props, those new items/replaced items have not had Sortable.create called on them, and therefore their DOM elements are not sortable.

This is due to having the Sortable.create call only in componentDidMount but not also in componentDidUpdate

onDrop or onEnd Event?

Cheton, thanks for the react-sortable component. Question: besides the onChange event, is there an onDrop or onSortEnd event? At the moment, I have two sortable parent containers that have child lists in them. If I drag and drop a child list within one parent, everything is fine and only one onChange event is emitted. However, when dragging a child from one parent container to another I receive two onChange events, which is not very efficient. Thus, I'd like to receive only the final event based on a "drop" event of some sort.

Any help is greatly appreciated!

Thanks!

Support server-side rendering

Got this error when rendering on server.

[1] [piping] error given was: ReferenceError: window is not defined
[1]     at node_modules/sortablejs/Sortable.js:57:9

how to access the store methods in React Lifecycle methods?

Is there a way for me to call the sortable.sort() method inside a React Lifecycle method like componentDidUpdate? I can't think of an appropriate way to get the sorting order...

I've already put the data-id attribute to my sortable React components but no luck. Any clues?

React 16 Support

Currently, this project looks for React 14 or 15. Any plans for 16? Would love to use this in my current project. Thanks!

Possible to exclude items?

I know the option draggable works with Sortable, but does that translate correctly with this React implementation? I'm getting weird issues, as if the first item sometimes gets ignored.

I will try to put up a concrete example but I wanted to know if anyone had success with this already.

Move and Clone elements from the same list

Hello,

I have 3 List. Client is supposed to drag elements from list A to B and C. Would it be possible to clone elements when user drag from list A to B, BUT move it (remove from A) when user drags from A to C?

I was trying to always clone elements, and remove it manually from list A if needed, but after upgrading to React 15 it throws an error.

Best Regards,

Not update sortable items

Hi!
i have peace of code

class Todos extends Component {
    state = {
        todos: []
    }

    componentWillMount() {
        this.setState({
            todos: this.props.todos
        })
    }
    componentWillReceiveProps(nextProps) {
        this.setState({
            todos: nextProps.todos
        })
    }

    renderTodos() {
        return this.state.todos.map(todo => {
            return <Todo {...todo} key={todo.id} />
        })
    }
    render() {
        let opt = {
            onUpdate: this.onUpdate,
            model: 'todos'
        }

        return <div>
            <Sortable tag="div" className="todos-wrapper" options={opt}>
                {this.renderTodos()}
            </Sortable>
        </div>
    }
}

list of todos come from reducer. onUpdate - function that send new position to server, server response with new list of todos. New list todos set as props to component Todos.
If server response with previous version of sorting, sortable items dont change to new positions

Sortable handle property

Hi @cheton, does react-sortable support the Sortable handle property?

I get the error: "Unknown prop handle on

    tag."

                                <Sortable
                                    handle=".my-handle"
                                    options={{
                                        animation: 150
                                    }}
                                    className="block-list"
                                    ref={c => {
                                        if (c) {
                                            this.simpleList = c.sortable;
                                        }
                                    }}
                                    tag="ul"
                                >
                                    {simpleList}
                                </Sortable>
    

Is there an easy way to access attributes of target element?

I have a custom data attribute on my draggable elements that consist of some extra information. I can access the attributes of the dragged item but I cannot find a way to get attributes of the target element.

onChange={(order, sortable, evt) => {
    console.log(evt.item.attributes.data.value) // works fine
    console.log(evt.target.attributes.data.value) // need something like this
}

How can do this?

Passing Model via .props rather than .state / Syncing with Redux or other Flux implementation

Hello & thanks for a great component!
Working on integrating it with my project now.

One thing I'm curious about is a scenario where I'm passing my would-be model to my component via props (via Redux), but the HoC is expecting my model to be available via state.

For now, I'm going to add some glue to keep my component's state up-to-date with the props being passed in. But it seems like an anti-pattern.

Wondering if you had any thoughts or experience wiring this up to a Flux implementation?

My gut feeling is that it would be nice to specify whether the model is on state or props... Maybe something like options.modelContainer: 'props' // default: 'state'

Seems like I should be able to update Redux using an action dispatcher call using one of the provided callback options.

Anyway, thanks again.

Update: just noticed the store option... might be able to use this...

Update 2: I ended up switching to https://github.com/gaearon/react-dnd, which definitely has a little bit of a learning curve to it compared to the simplicity of react-sortable. But ultimately, I found it more flexible for what I was trying to achieve.

Does not rerender elements inside <li> tags unless order is changed

Is there any way to trigger a force rerender of the Sortable component? I want to add a dropdown to each Sortable that appears when clicking on an item. My menu will not show until I change the order of items in the list. I'm not sure why it's not rendering but it seems Sortable is blocking the render. I need the dropdown to be inside the list item for positioning.

Name confusion with `react-sortable` npm package

Since there's another project in npm called react-sortable, and this project's name in npm is react-sortablejs, I think it would make sense to rename this GitHub repo and all documentation to always refer to this project as react-sortablejs.

Request: Access to the sortable instance

I would like to be able to call methods on the sortable instance from inside my component, which I believe means we would need to passed in the instance as a prop.

Use case: being able to set options after the fact, based on certain conditions. For example: disabling sorting based on a toggle requires a call to sortable.set('disabled', true) which necessitates access to the sortable instance.

Components inside dragged and cloned elements

Hi,

I have issue with dragging items between two containers.
I have Toolbar:
group: { name: 'creator', pull: 'clone', put: false },
from which i'm dragging elements to Workspace:
group: { name: 'creator', pull: true, put: true },

Inside some dragged items (div) I have other react components (fileupload - https://www.npmjs.com/package/react-fileupload). I drag (clone) element with fileupload component to Workspace and fileupload works fine. But when I drag same item from Toolbar to Workspace (clone) it does not work.
I'm new to react, but as far as I can check, when I drag (clone) item from Toolbar to Workspace, original item is appended to Workspace, and cloned item is still visible on Toolbar list, but component inside (this item in Toolbar) is already not working.
Is there any way to fix such behaviour?

Thanks.

Cannot toggle disabled in controlled component

In a controlled component such as below in your example.
I added <Sortable options={{disabled: this.props.readonly}}....

Even though I toggle this.propsreadonly value(boolean), the Sortable component does not reflect the changes for some reason.

Is there a way to enable/disable the sortable dynamically by changing a value?

import uniqueId from 'lodash/uniqueId';
import React from 'react';
import ReactDOM from 'react-dom';
import Sortable from '../src';

class App extends React.Component {
    state = {
        items: ['Apple', 'Banana', 'Cherry', 'Guava', 'Peach', 'Strawberry']
    };

    render() {
        const items = this.state.items.map(val => (<li key={uniqueId()} data-id={val}>{val}</li>));

        return (
            <div>
                <Sortable
                    tag="ul" // Defaults to "div"
                    onChange={(order, sortable, evt) => {
                        this.setState({ items: order });
                    }}
                >
                    {items}
                </Sortable>
            </div>
        );
    }
}

ReactDOM.render(
    <App />,
    document.getElementById('container')
);

Text Select

I am not able to select the text inside the sortable component.
Is there any property through which text selection is possible.

Failed prop type: Invalid prop `tag` of type `function` supplied to `Sortable`, expected `string`

Trying to use this library with Ant design. My implementation is as follows:

import { Row } from "antd"
<Sortable tag={Row} />

This works, but I get the error in the title `Failed prop type: Invalid prop 'tag' of type 'function' supplied to 'Sortable', expected 'string'.

I haven't had a chance to look at this libraries source code yet, but is it possible to relax the prop type for the tag?

I tried using a string of "Row" for the tag but I get even more errors that seem to come more from React's end.

<Row /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.

The tag <Row> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.

Making component fully controlled (props-driven)

Hello, thank you for this library.

I have stumbled upon a problem, where I need to dynamically toggle Sortable disability through props change. However, Sortable does not respond to change of options of any kind. This is caused due to these lines:

delete props.options;
delete props.onChange;

Is there any particular reason for that?

I was able to achieve my goals by removing above lines and with this:

componentDidUpdate(prevProps, prevState) {
        if (prevProps.options.disabled !== this.props.options.disabled) {
            this.sortable.option('disabled', this.props.options.disabled);
        }
}

It also can be expanded to make component respond for any option change (since RubaXa's API allows that)

I think this component should follow React idioms, and be open to be controlled from outside using props, and it's a responsibility of this component for doing so. I can prepare PR for this change, if it's welcome

Way to get props/state of sortable items

Hi!
Have some way to access sortable items props/state?
in code below in onUpdatecallback i want get some props from dragged Todo

class Todos extends Component {
    ...
    renderTodos() {
        return this.state.todos.map(todo => {
            return <Todo {...todo} key={todo.id} />
        })
    }
    render() {
        let opt = {
            onUpdate: this.onUpdate,
            model: 'todos'
        }

        return <div>
            <Sortable tag="div" className="todos-wrapper" options={opt}>
                {this.renderTodos()}
            </Sortable>
        </div>
    }
}

Controlled Component Not Deleting Dragged Item

Hi there,

I just tried the example on my local machine and the controlled component does not seem to work. The dragged item gets added back to the original list.

Sortable JS - 1.5.0
React Sortable JS - 1.3.0

Clone option throws error with React v0.14.7

When I setup two sortable lists, and group them,
with one being set to pull: 'clone'

As soon as I drag the element and drop it on the list with put: true,
The receiving list updates with the new, cloned element as expected,
but the source list gets a duplicate copy of the dropped element, and then react throws the following error: Uncaught Invariant Violation: ReactMount: Two valid but unequal nodes with the same 'data-reactid': .0.0.$5

This might be related to the unmerged fix here: SortableJS/Sortable#612

Just wondering if you're able to reproduce this, or if it's something with my setup.

Let me know if you need a jsfiddle

onChange bug with multiple instances

I've implemented react-sortablejs on a project I'm working on and for the most part it's worked very well. However, we noticed a possible bug that may be a side effect of using multiple instances on the same page. See the following simplified example:

<div>
  <Sortable
    onChange={(order, sortable, evt) => {
      alert('first');
    }}>
    <div>1</div><div>2</div>
  </Sortable>
  <br/><br/>
  <Sortable
    onChange={(order, sortable, evt) => {
      alert('second');
    }}>
    <div>3</div><div>4</div>
  </Sortable>
</div>

Re-order the first instance (1 and 2) and an alert appears displaying 'first' as expected. However, then order the second instance (3 and 4) and an alert appears displaying 'second', then 'first' again immediately afterwards.

I've tried specifying different options.group values and also using ReactSortable instead of Sortable but no difference.

Note: we're using 1.3.6 due to breaking changes when upgrading to >=1.4.0.

Question on Shared Groups

I've got this following bit of code that renders out a board. I placed the Shared group option in and I can't move any item to other lists. Each board is part of another list. Do I have to render the Sortable directly?

  render() {
    let items = this.props.tasks.map((task, index) => <Task key={index} {...task}/>);
    return (
      <Col sm={3} className='board'>
        <div className='board-container'>
          <div className='board-title'>
            {this.props.title}
          </div>
            <div className='board-list-container'>
            <div className='board-list'>
              <Sortable
                options={{
                  group: 'shared'
                }}>
                {items}
              </Sortable>
            </div>
          </div>
        </div>
      </Col>
    );
  }

Edit: I tried this

  render() {
    let items = this.props.tasks.map((task, index) => <Task key={index} {...task}/>);
    return (
      <Sortable
        options={{
          group: 'shared'
        }}>
        {items}
      </Sortable>
    );
  }

It still doesn't work
For each board though I have the following:

render() {
   let boards = Array.from(this.state.boards);
   return (
     <div className='boards'>
       {boards.map(board =>
         <Col sm={3} className='board'>
           <div className='board-container'>
             <div className='board-title'>
               {board[1].title}
             </div>
               <div className='board-list-container'>
               <div className='board-list'>
                 <Board key={board[0]} {...board[1]} /> ///// <---- Each board here
               </div>
             </div>
           </div>
         </Col>
       )}
     </div>
   );
 }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.