Giter Site home page Giter Site logo

lexfro / react-layer-stack Goto Github PK

View Code? Open in Web Editor NEW
160.0 4.0 10.0 4.19 MB

Layering system for React. Useful for popover/modals/tooltip/dnd application

Home Page: https://fckt.github.io/react-layer-stack

License: MIT License

JavaScript 100.00%
react react-component layer layers tooltip popover window windowing dropdown overlay

react-layer-stack's Issues

Broken in React 15.5+ because of PropTypes

Since React 15.5, PropTypes were removed from react itself and must now be imported from "prop-types". This breaks react-layer-stack, because all type definitions here still try to access _react2.default.PropTypes.something, but since _react2.default.PropTypes is undefined, everything crashes.
This is quite unfortunate because this module looks exactly like what I need for my current project...

Behaviour of "use" property in Layer component

Hi Alexey,
I have some trouble with use option. My code was:

<Layer id="my-id">
  {() => <MyComponent item={item} />}
</Layer>

But MyComponent did not get changed after update parent's property item from item.children = ['a'] to item.children = ['a', 'b'].

I have fixed that by this code:

<Layer id="my-id" use={item.children}>
  {() => <MyComponent item={item} />}
</Layer>

May be it should be more predictable here.
For example, always return true in shouldComponentUpdate (https://github.com/fckt/react-layer-stack/blob/master/src/components.js#L61) if there is no use parameter defined by user and there is no way to detect children props changes.
What do you think?

Add function aliases

Awesome library! Thanks.

I only find the function names: showMe, hideMe and showOnlyMe a little "childish". (Sorry, I don't know how to say it otherwise).

callback({ isActive, showMe: callback(args), showOnlyMe, hideMe, hideAll })

Can these be aliased? This is what I'm thinking about:

showMe » add
I guess this one should be called add. Because this function will add the element to the DOM, and not just setting a style to make it visible.

showOnlyMe » set
The LayerContext is being set to display this layer, instead of adding it to the context.

hideMe » remove
I would call it remove. Because this function will remove the element from the DOM, and not just setting a style to make it invisible.

hideAll » reset
I would call it reset or clear. If you don't like that name; you can also go with removeAll.

Can not connect to redux

Can you show example of using our own reducer? Apparently it doesnt work

mapStateToProps() in Connect(Component) must return a plain object. Instead received undefined.

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.