react-component / m-picker

React Mobile Picker(web & react-native)
http://react-component.github.io/m-picker/
247 stars 73 forks source link

react中使用报错Uncaught TypeError: Cannot read property 'Item' of undefined,如何解决 #162

Closed KuaiYu95 closed 5 years ago

KuaiYu95 commented 5 years ago
import { MultiPicker, Picker} from 'rmc-picker';
---
<div style={{ background: '#f5f5f9', padding: 10 }}>
            <MultiPicker
              selectedValue={this.state.value}
              onValueChange={this.onChange}
              onScrollChange={this.onScrollChange}
            >
              <Picker indicatorClassName="my-picker-indicator">
                <Picker.Item className="my-picker-view-item" value="1">one</Picker.Item>
                <Picker.Item className="my-picker-view-item" value="2">two</Picker.Item>
                <Picker.Item className="my-picker-view-item" value="3">three</Picker.Item>
                <Picker.Item className="my-picker-view-item" value="4">four</Picker.Item>
                <Picker.Item className="my-picker-view-item" value="5">five</Picker.Item>
                <Picker.Item className="my-picker-view-item" value="6">six</Picker.Item>
                <Picker.Item className="my-picker-view-item" value="7">seven</Picker.Item>
                <Picker.Item className="my-picker-view-item" value="8">eight</Picker.Item>
              </Picker>
              <Picker indicatorClassName="my-picker-indicator">
                <Picker.Item className="my-picker-view-item" value="11">eleven</Picker.Item>
                <Picker.Item className="my-picker-view-item" value="12">twelve</Picker.Item>
                <Picker.Item className="my-picker-view-item" value="13">thirteen</Picker.Item>
                <Picker.Item className="my-picker-view-item" value="14">fourteen</Picker.Item>
                <Picker.Item className="my-picker-view-item" value="15">fifteen</Picker.Item>
                <Picker.Item className="my-picker-view-item" value="16">sixteen</Picker.Item>
                <Picker.Item className="my-picker-view-item" value="17">seventeen</Picker.Item>
                <Picker.Item className="my-picker-view-item" value="18">eighteen</Picker.Item>
              </Picker>
            </MultiPicker>
          </div>
app.bundle.js:189551 Uncaught TypeError: Cannot read property 'Item' of undefined
    at Object.<anonymous> (app.bundle.js:189551)
    at __webpack_require__ (app.bundle.js:1299)
    at fn (app.bundle.js:722)
    at Object.<anonymous> (app.bundle.js:181898)
    at __webpack_require__ (app.bundle.js:1299)
    at fn (app.bundle.js:722)
    at Object.<anonymous> (app.bundle.js:75501)
    at __webpack_require__ (app.bundle.js:1299)
    at fn (app.bundle.js:722)
    at Object.<anonymous> (app.bundle.js:283796)