Comments (11)
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.
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.
A naive question, what does FRP mean???
from react-future.
@haohcraft Functional Reactive Programming
from react-future.
👍 would love to see this
from react-future.
@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.
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.
👍
from react-future.
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.
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.
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)
- Flux over the Worker HOT 6
- working around with specificity and autoprefixer HOT 6
- Web Worker Rendering Idea HOT 3
- Support memoization of component functions during render phase HOT 16
- Discuss Conditional JSX Expression HOT 32
- Attempt to improve "Returning state" section HOT 12
- Knowing which of these made it into 0.14 HOT 1
- Lifecycle methods: drop the 'component'. just 'willMount'. it's cleaner HOT 16
- Is there any plan of implementing in webgl mode? HOT 1
- Passing styles around should be discouraged HOT 1
- Generators for async sequences
- Classes - 1 HOT 1
- Cached Data
- Killing React.createElement HOT 1
- React compiling down to raw application code HOT 24
- Consider allowing attribute logic HOT 47
- Stateless Functions are already implemented
- React as a Specification
- App breaks if i try to directly access the url - With Error - Choose is not defined
- Add new properties: `classNames` and `styles`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-future.