Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- handleOnClick = () => {
- fetch(proxyUrl + targetUrl)
- .then(res => res.json())
- .then(shop => {
- console.table(shop); // create table in console
- this.setState({
- shop ,
- isLoading:false,
- });
- })
- .catch(e => {
- console.log(e);
- });
- } ;
- constructor() {
- super();
- function handleOnClick() {
- fetch(proxyUrl + targetUrl)
- .then(res => res.json())
- .then(shop => {
- console.table(shop); // create table in console
- this.setState({
- shop ,
- isLoading:false,
- });
- })
- .catch(e => {
- console.log(e);
- });
- } ;
- }
- handleOnClick();
- state = {
- isLoading: true,
- shop: null,
- error: null
- };
- setState({shop ,isLoading:true}).then(this.setState({ shop , isLoading:false }); })
- handleSubmit(e) {
- e.preventDefault();
- this.forceUpdate();
- .
- .
- .
- .
- onClick={() => {console.log("test"); this.forceUpdate()} }
- constructor(){
- super();
- this.forceUpdateHandler = this.forceUpdateHandler.bind(this);
- };
- forceUpdateHandler(){
- this.forceUpdate();
- };
- .
- .
- .
- onClick={() => {console.log("test"); this.forceUpdateHandler()} }>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement