Giter Site home page Giter Site logo

react-wrapper's People

Contributors

claviska avatar pqt avatar

Stargazers

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

Watchers

 avatar  avatar

react-wrapper's Issues

Several bugs and some remarks

Some issues:

  • The first argument of method componentDidUpdate is prevProps => we should pass this.props to syncProps instead:

    componentDidUpdate(props) {
    this.syncProps(props);
    }

  • The second part of this condition should be removed

    if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {

    otherwise something like <SlSelect onsl-change={...}/> will not work.

  • I do not understand why this.element has to be of type RefObject<HTMLElement> ...
    it could easily be of type HTMLElement | null, couldn't it?

    Just a remark:
    Frankly, I personally do not really like this it.element.current.someMethod() thingy (it does not feel very reactish). Wouldn't somethig like it.someMethod() be much nicer? Would mean that the wrappers of all Shoelace component should be generated by a script (which they should be anyway, I guess) or the meta information about the method names should be available at runtime (static class field or @method decorator or whatever). Using React.forwardRef could also be an alternative, I guess. [Edit] I think React.forwardRef is the way to go.

  • (no bug) Wrapper component should have a useful displayName for debugging purposes.

No Typescript/tsx support

When I import the react wrapper in a .tsx file, it throws the error 'Could not find a declaration file for module '@shoelace-style/react-wrapper'.' is there something I'm doing wrong or is there just no typescript support for this. I only ask because there are types for the individual components.

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.