Git Product home page Git Product logo

Comments (3)

ctron avatar ctron commented on July 21, 2024

Yup, I know that IDs are currently not very well supported. I saw that the PF React stuff random IDs if they are missing, which would also be my preference. Then combine them as you suggested.

We already have the uuid crate on board. And having a v4 UUID should be fine. This is actually being used in some places already.

I am not sure if we can get away with our own type, as the ID needs to be stable during re-renders. So I guess an Option<String> should work, combined with use_memo to generated derived strings. Which is actually available as use_prop_id already (name could be improved).

We could add another use_prop_id_suffixed (again, naming!) which accepts the ID from the properties as well as a static suffix which will be added.

from patternfly-yew.

phill-85 avatar phill-85 commented on July 21, 2024

Yeah, I did actually find this a couple days ago. Was wondering about the use_memo portion of it, the id shouldn't change right?

from patternfly-yew.

ctron avatar ctron commented on July 21, 2024

Right, the id shouldn't change. But if the Option is None, then one would need to create an alternative value (random) which should be memoized.

from patternfly-yew.

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.