Giter Club home page Giter Club logo

Comments (10)

Sinewyk avatar Sinewyk commented on June 3, 2024

As a sidenote: I think tons of issues are going to disappear.

Right now if I go from <p className="foo">Foo</p> to <p>Bar</p> then the className is not deleted.

Is suspect because it receives null instead of {} ...

from snabbdom-pragma.

Sinewyk avatar Sinewyk commented on June 3, 2024

Forget it. You do send {} in case of null and you have the tests to verify it, so why do I get destructuration issues 😥

from snabbdom-pragma.

Sinewyk avatar Sinewyk commented on June 3, 2024

Ok I get it. You don't sanitize props if the sel is a function (custom components). So doing something like

function MyCustomStuff({ someProp }) {
  return <div someProp/>;
}

But using it like this

<MyCustomStuff/>
// which desugars to
h(MyCustomStuff, null, []);
// instead of 
// h(MyCustomStuff, {}, []);

breaks down. Even if we use default arguments in the component implementation (because null !== undefined).

Should we consider this a bug ? Or should we also sanitize props when using custom components ?

from snabbdom-pragma.

Sinewyk avatar Sinewyk commented on June 3, 2024

Would you accept a PR @Swizz or ?

from snabbdom-pragma.

ryota-ka avatar ryota-ka commented on June 3, 2024

Any progress on this?

from snabbdom-pragma.

Swizz avatar Swizz commented on June 3, 2024

Hi,
I have no ETA on this.
TBH I am not using Snabbdom anymore as I am now a contributor/member of Hyperapp.

Maybe, I will proceed with PR only at the moment.

from snabbdom-pragma.

blikblum avatar blikblum commented on June 3, 2024

I have a fix at: https://github.com/blikblum/snabbdom-pragma/tree/allow-components-without-props

waiting for #29 to create the PRs

from snabbdom-pragma.

blikblum avatar blikblum commented on June 3, 2024

If anyone is interested i published a package with the fix as snabbdom-pragma-lite.

With bonus you get 30% smaller code, no dependency on extend and 10x faster in real world usage

from snabbdom-pragma.

Swizz avatar Swizz commented on June 3, 2024

In case some of you are interested in this, I am open of transferring ownership or adding you as a contributor, as you wish.

from snabbdom-pragma.

blikblum avatar blikblum commented on June 3, 2024

I would be happy to take the duty of maintaining it

from snabbdom-pragma.

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.