codingphasedotcom / hyperapp-starterkit

112 stars 3 forks source link

Hyper App Restaurant Course #2

Open ddpetty opened 6 years ago

ddpetty commented 6 years ago

A student on your Discord channel came to me about an issue about the Header component not rendering in the browser. They said that they followed your tutorial and the syntax ended up causing errors. I have two fixes.

In the Header.js file:

import {h, app} from "hyperapp" 

export default function Header({state, actions}) {
  return (
    <header>
      <div class="logo">
         Logo
      </div>
    </header>
  )
}

and in the App.js file:

import { h, app } from "hyperapp"
import Header from './Header.js'

export default function App({state, actions}) {
  return (
    <div class={'app'}>
    <Header state={state} actions={actions}/>
    </div>
  )
}
alanperez commented 6 years ago

@ddpetty thanks

ddpetty commented 6 years ago

You’re welcome! On Fri, Aug 10, 2018 at 5:35 PM Alan Perez notifications@github.com wrote:

@ddpetty https://github.com/ddpetty thanks

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/codingphasedotcom/hyperapp-starterkit/issues/2#issuecomment-412212819, or mute the thread https://github.com/notifications/unsubscribe-auth/AYsNboW_4g4P9YAZPQtMcLzVITU7Q2pKks5uPfyQgaJpZM4U-aNB .