Archived
scroll lista iniziale, link react readme, minor changes
This commit is contained in:
+13
-3
@@ -6,12 +6,22 @@ class Wikipedia extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
data : {},
|
||||
data: {},
|
||||
infobox: {},
|
||||
error: null,
|
||||
isLoaded: false
|
||||
|
||||
};
|
||||
this.getWikiBox = this.getWikiBox.bind(this);
|
||||
}
|
||||
|
||||
getWikiBox(name){
|
||||
wikijs()
|
||||
.page(name)
|
||||
.then(page => page.fullInfo())
|
||||
.then(infobox => console.log(infobox)
|
||||
//this.setState({ infobox })
|
||||
);
|
||||
//console.log('infobox', this.state.infobox)
|
||||
}
|
||||
|
||||
// componentWillMount() {
|
||||
@@ -19,7 +29,7 @@ class Wikipedia extends Component {
|
||||
// }
|
||||
|
||||
componentDidMount() {
|
||||
wikijs().search(this.props.query,1).then(data => {
|
||||
wikijs().search(this.props.query).then(data => {
|
||||
this.setState({
|
||||
data,
|
||||
isLoaded: true
|
||||
|
||||
Reference in New Issue
Block a user