Comments (1)
In order to "bind" a text input, you need to set the Value
and OnChange
fields on the InputProps
.
The simplest example of this (that happens to use a <textarea>
but it's identical in approach) is:
https://blog.myitcv.io/gopherjs_examples_sites/markdowneditor/
The relevant bit of source code is:
react/examples/markdowneditor/markdown_editor.go
Lines 50 to 54 in 57b1679
That explains why you can't input anything.
Why so many no use attribute under input tag.
This is as a result of zero values for those properties. Unlike JavaScript, if, for example, a field is of type bool
, Go has a zero value of false
(in JavaScript it would be undefined
). For a string
field the zero value is ""
. Hence when we come to render elements, you will often see the zero value being "set" in such fields, even if you haven't set a value yourself. There should be no impact/problems as a result, but please say if there is (there are some edge cases where we do need to distinguish a field having been set or not).
I'm going to close this issue for now because I think the markdown example should answer your main query, but please re-open in case you need to.
from react.
Related Issues (20)
- More CSS Types/Styles HOT 4
- Feature Request HOT 1
- Define aria-* attributes HOT 1
- Make go modules-compatible and switch to mono-repo HOT 18
- reactGen produces illegal code if element name starts with `v` HOT 1
- react.go line 71 conflicts with naming on HTML5 element `<s>` HOT 2
- Unable to use Props and States with maps and slices HOT 3
- How to write tests? HOT 3
- jsx.HTML silently fails to render valid input HOT 2
- Issue serving the HelloWorld page built by ReactGen (Windows 8.1 Command Prompt) HOT 3
- Any suggestion import external react component?
- Form OnSubmit not mapped in FormProps
- ReactGen crash when judge HasEquals HOT 1
- StateGen store date conflict HOT 4
- State changes
- go get not working HOT 5
- Feature Suggestion: reactGen -init materializecss
- chrome react extension HOT 1
- how to import packages from npm
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.