-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor #7
Comments
will do stateless components only |
propTypes -- maybe add this |
props for later https://zhenyong.github.io/react/docs/jsx-spread.html |
hard part, and essential passing components as props -- very common pattern in react land mixing switch with non state props (that do not live on the hub) |
import { App, Head, Body, Page, Menu } from '@vigour-io/swan'
const Carousel = props => <div>
<div>{ props.title }</div>
<div>{ props.items.map(p => <div>{ p.title }</div>) }</div>
</div>
const Grid = props => <div>
<div>{ props.title }</div>
<div>{ props.items.map(p => <div>{ p.title }</div>) }</div>
</div>
export default props => <App>
<Head />
<Body>
<Menu />
<Page>
{ props.currentPage.map(p => {
if (p.component === 'Carousel') {
return <Carousel title={p.title} items={p.items} />
} else {
return <Grid {...p} />
}
}) }
</Page>
</Body>
</App> |
COMPILER
RENDER-FN
use this repo to refactor to final version of brisky
brisky will become a 1 - 1 react compatible framework
The text was updated successfully, but these errors were encountered: