Coder Social home page Coder Social logo

Comments (11)

sophiebits avatar sophiebits commented on May 3, 2024

The fact that we're encouraging users to go to the DOM directly also prevents the creation of a custom <FancyInput /> component that mirrors the native <input /> API but does all the drawing, etc by hand.

from react-future.

sebmarkbage avatar sebmarkbage commented on May 3, 2024

This is part of having a generic and a blessed way of doing both FRP signals and FRP events in both directions. Preferably in a less imperative way.

<input value={...} /> // downwards signal
<input onChange={...} /> // upwards event

this.refs.myInput.getValue(); // upwards signal
this.refs.myInput.focus(); // downwards event

from react-future.

haohcraft avatar haohcraft commented on May 3, 2024

A naive question, what does FRP mean???

from react-future.

vjeux avatar vjeux commented on May 3, 2024

@haohcraft Functional Reactive Programming

from react-future.

jaredly avatar jaredly commented on May 3, 2024

👍 would love to see this

from react-future.

ustun avatar ustun commented on May 3, 2024

@haohcraft He means Functional Reactive Programming here, but FRP is also used for Functional Relational Programming in "Out of the Tarpit" paper. This usage is much less common though.

from react-future.

nmn avatar nmn commented on May 3, 2024

This sounds like a great Idea. But it would need more thought, as if it is done, it should be done for a lot more use cases than just getValue();

Also want to add that Async getDOMNode() is a great thing!

from react-future.

dey-dey avatar dey-dey commented on May 3, 2024

👍

from react-future.

nmn avatar nmn commented on May 3, 2024

So this issue was raised way before React-Native was annouced, so I guess I was being a little myopic.

At this point I think having a generic way to get and set values would be a great idea. That said, it would necessarily need to work with objects, kind of like setState.

Many components can have many different kinds of data that they store, returns and fire events for.

from react-future.

moimikey avatar moimikey commented on May 3, 2024

I was initially confused by the two different means of actually getting an input value between the two during a code review (we're doing some investigatory spikes with React). aside from this.refs.myInput.getDOMNode().value seeming more like an abstraction, are there any caveats between that and e.target.value, or are they indefinitely 1-to-1? a getValue method seems to most intuitive, but my lack of core knowledge makes that a brittle opinion.

from react-future.

sebmarkbage avatar sebmarkbage commented on May 3, 2024

I don't think we'll actually end up doing this for built-ins since they will return the actual DOM node and therefore, we can't new methods to it. Instead, a generic version would use a getter.

I'll close this out because this isn't actionable, but feel free to reboot the conversation with a different proposal if we need more unification.

from react-future.

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.