无法在react中键入和更新输入元素的状态

时间:2016-10-22 20:26:26

标签: reactjs

我有一个文本框,在输入名称时,我会通过api调用获得一个选项列表。然后我填充一个列表,然后单击列表项我试图填充输入框中的文本。首先,当我向输入元素添加值prop时,我无法在文本框中键入任何内容。此外,单击列表项时,文本的值不会更新。谁能告诉我这里做错了什么

Run from outside a project, using implicit global project config
Using resolver: ghc-7.10.3 from implicit global project's config file: /home/me/.stack/global-project/stack.yaml

While constructing the build plan, the following exceptions were encountered:

In the dependencies for hindent-5.2.1:
    descriptive must match >=0.7 && <0.10, but the stack configuration has no specified version
                (latest applicable is 0.9.4)
    exceptions must match -any, but the stack configuration has no specified version (latest applicable is 0.8.3)
    haskell-src-exts must match >=1.18, but the stack configuration has no specified version
                     (latest applicable is 1.18.2)
    monad-loops must match -any, but the stack configuration has no specified version (latest applicable is 0.4.3)
    mtl must match -any, but the stack configuration has no specified version (latest applicable is 2.2.1)
    path must match -any, but the stack configuration has no specified version (latest applicable is 0.5.9)
    path-io must match -any, but the stack configuration has no specified version (latest applicable is 1.2.0)
    text must match -any, but the stack configuration has no specified version (latest applicable is 1.2.2.1)
    unix-compat must match -any, but the stack configuration has no specified version (latest applicable is 0.4.2.0)
    utf8-string must match -any, but the stack configuration has no specified version (latest applicable is 1.0.1.1)
    yaml must match -any, but the stack configuration has no specified version (latest applicable is 0.8.20)

Recommended action: try adding the following to your extra-deps in /home/me/.stack/global-project/stack.yaml:
- descriptive-0.9.4
- exceptions-0.8.3
- haskell-src-exts-1.18.2
- monad-loops-0.4.3
- mtl-2.2.1
- path-0.5.9
- path-io-1.2.0
- text-1.2.2.1
- unix-compat-0.4.2.0
- utf8-string-1.0.1.1
- yaml-0.8.20

0 个答案:

没有答案