JeromeFitz / react-instafeed

⚛️ React + 🖼️ Instafeed = 😀️
59 stars 6 forks source link

Syntax error: Unexpected token, expected #4

Closed officialdrafty closed 7 years ago

officialdrafty commented 7 years ago

I created a new file called image_feed.js and did a import Gallery from '../src/instagram/image_feed'; in the index.js.

This first time working with react-instafeed want to see if did everything correctly.

My Repo: https://github.com/brandonpowell/main-kdrusha-website/blob/master/src/instagram/image_feed.js

Error in ./src/instagram/image_feed.js
Syntax error: Unexpected token, expected , (56:11)

render() {
    return (
      {this.renderInstafeed()}
     )
   };
}
JeromeFitz commented 7 years ago

Without pulling your code down at the moment, I believe there are a few things to try.

1) Add this under the react import:

import Instafeed from 'react-instafeed';

2) You will need to put in your: userId, clientId, accessToken.

There are ways to do this without having it be hard-coded in the repo. In my usual build process I have been using: babel-plugin-transform-define

3) Potentially tidy up around ~Line 54 (though it looks like your build process does it for you per your error message).

In PR #3 by @filosofikode, he suggests wrapping in a <div> as well.

  render() {
    return (
      <div id='instafeed'>{this.renderInstafeed()}</div>
    )
  }
JeromeFitz commented 7 years ago

Closing this as referenced in #5