GithubHelp home page GithubHelp logo

Comments (3)

dbachrach avatar dbachrach commented on May 14, 2024 5

@clauderic Sounds fair. I mostly wanted to post this for anyone in the future looking to go down the component route. Thanks.

from react-sortable-hoc.

dbachrach avatar dbachrach commented on May 14, 2024

I'm finding the component way easier as well. I'm using this:

import React, { PropTypes } from 'react';
import { SortableContainer, SortableElement, SortableHandle } from 'react-sortable-hoc';

export const SortHandle  = SortableHandle(({ children }) => children);
export const SortElement = SortableElement(({ children }) => children);
export const SortContainer = SortableContainer(({ children, wrapper = 'div' }) =>
  React.createElement(wrapper, { children })
);

SortHandle.propTypes = { children: PropTypes.node };

SortElement.propTypes = { children: PropTypes.node };

SortElement.propTypes = {
  children: PropTypes.node,
  wrapper: PropTypes.string.isRequired
};

from react-sortable-hoc.

clauderic avatar clauderic commented on May 14, 2024

Hey @dbachrach, thanks for sharing this. I think it's a neat approach for people who'd rather go down the component route.

Having said that, the idea is to keep react-sortable-hoc as flexible as possible to ensure compatibility with as many other components / libraries as possible, which is why I still privilege the HOC approach.

I'm going to close this issue because I see this as a non-issue and don't want newcomers to be under the impression that there are plans to move in this direction. Feel free to re-open with a PR if you feel strongly about this, and we can discuss there.

from react-sortable-hoc.

Related Issues (20)

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.