scroll lista iniziale, link react readme, minor changes

This commit is contained in:
matteo
2018-11-21 21:14:52 +01:00
parent 1a1ba9756f
commit 403cbc013d
6 changed files with 30 additions and 14 deletions
+13 -3
View File
@@ -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