I have a syntax error I can’t figure out here: <ht...
# prisma-whats-new
e
I have a syntax error I can’t figure out here: https://github.com/erichodges/react-gql-tutorial/blob/master/hackernews-react-apollo/src/components/Header.js I’m working on this tutorial: https://www.howtographql.com/react-apollo/5-authentication/ ./src/components/Header.js Syntax error: Adjacent JSX elements must be wrapped in an enclosing tag (17:10) 15 | {userId && 16 | <div className=‘ml1’>|</div>
17 | <Link to=‘/create’ className=‘ml1 no-underline black’>submit</Link>
| ^ 18 | </div> 19 | } 20 | </div>
i
Copy code
class Header extends Component {
  render() {
    const userId = localStorage.getItem(GC_USER_ID);
    return (
      <div className='flex pa1 justify-between nowrap orange'>
        <div className='flex flex-fixed black'>
        <div className='fw7 mr1'>Hacker News</div>
          <Link to='/' className='ml1 no-underline black'>new</Link>
          {userId &&
            <div>
              <div className='ml1'>|</div>
              <Link to='/create' className='ml1 no-underline black'>submit</Link>
            </div>
          }
        </div>
        <div className='flex flex-fixed'>
          {userId ?
            <div className='ml1 pointer black' onClick={() => {
              localStorage.removeItem(GC_USER_ID);
              localStorage.removeItem(GC_AUTH_TOKEN);
              this.props.history.push(`/new/1`);
            }}>logout</div>
            :
            <Link to='/login' className='ml1 no-underline black'>login</Link>
          }
        </div>
      </div>
    );
  } 
}
You missed a
<div>
in:
Copy code
{userId &&
            <div>
              <div className='ml1'>|</div>
              <Link to='/create' className='ml1 no-underline black'>submit</Link>
            </div>
          }
e
Cool, thanks! It’s working.
i
🙂
e
git video suggestion: I think I made shortcuts for the git add/commit etc. and I can’t remember them and I don’t know where to find them, lol.
i
git commit -am "Your commit message here"
Good suggestion though 🙂
Hmm… That may not be right, actually. I can’t remember… Haha
e
lol, no they area really short, as I recall. One with do “git add .” Then there’s one for commit etc.
there must be a place on the console where I can find my short cuts
but people should know that they can make sort cuts
i
Yeah, I’m not sure. I haven’t ever used shortcuts
git add <filename>
or
git add .
for all
git commit -m "Some message"
git push
to push those commits up
^ Those are the most-used commands
But, I was right.
git commit -am "Some message"
adds all of the files to git and commits them in a single command 😄
e
oh that’s cool
i
Yep! I’ve never used it but I see some people using it from time to time
e
way better
e
thx!
I used that command, awesome, soon I will alias it in zsh
🦜 1