GithubHelp home page GithubHelp logo

kyleamathews / react-component-width-mixin Goto Github PK

View Code? Open in Web Editor NEW
29.0 3.0 7.0 290 KB

React mixin which sets width as state variable and updates as component changes shape

Home Page: http://kyleamathews.github.io/element-resize-event/

License: MIT License

Makefile 19.22% JavaScript 80.78%

react-component-width-mixin's People

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

Watchers

 avatar  avatar  avatar

react-component-width-mixin's Issues

Scroll and handle go inside textbox

This bug appears in chrome (icognito, on a retina macbook pro and on an attached thunderbolt display). Just grabbed the handle and moved it around, this happens pretty quick. I'm not using this component at the moment, so I don't think I'll have time to look at the code, just figured I'd add a bug report regardless.

resize-event-bug

Child with same mixin

If you have parent and child with your mixin and you showing/hiding block inside child you don't have fallback to mobile or table if child's block mounted

parent

mixins: [componentWidthMixin],
render: function () {
        console.info('PARENT: ' + this.state.componentWidth);
        if(this.state.componentWidth > 600){
            return (<Desktop/>);
        }
        if(this.state.componentWidth > 400){
            return (<Tablet/>);
        }
        return (<Mobile />);
    }

and child

mixins: [componentWidthMixin],
render: function () {
        console.info('CHILD: '+ this.state.componentWidth);
        if(this.state.componentWidth > 1050){
            return <div>EXTRA Desktop</div>;
        }
        return <div>Desktop</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.