Giter Site home page Giter Site logo

Comments (3)

back2dos avatar back2dos commented on August 16, 2024

Ok, there's a workaround for now. The main idea was not to cause rerendering if callbacks change.

The null error can easily be avoided. But if we want someFunctionAttribute == null to work, that's a different story. We could make it so that one can write hasSomeFunctionAttribute instead. Or we burry this optimization

from coconut.ui.

back2dos avatar back2dos commented on August 16, 2024

Hmm, I think I like the optimization that's currently disabled and I'm thinking to reenable it in a few cases.

For starters, if the function is optional and has a non-null default, because then we know it'll never be null so the wrapping is safe.

Beyond that, I would also propose that when the attribute is mandatory and not Null it's meaningful to assume that null is invalid, especially since passing null as attribute in HXX probably doesn't work anyway due to type inference. So for mandatory non-Null function attributes, I'm inclined to enable this. We could make an explicit null check and throw an error that states more explicitly what's wrong, e.g. invalid null passed to onPress attribute of <Main /> or something.

from coconut.ui.

kevinresol avatar kevinresol commented on August 16, 2024

We can have a try

from coconut.ui.

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.