Skip to content

[WIP] Block proxy - #5

Closed
d3dc wants to merge 2 commits into
masterfrom
block-proxy
Closed

[WIP] Block proxy#5
d3dc wants to merge 2 commits into
masterfrom
block-proxy

Conversation

@d3dc

@d3dcd3dc commented Aug 5, 2018

Copy link
Copy Markdown
Owner

A solution to #2. Enables the following style where Box is omitted.

I'm not sure I like it, as it gives the appearance of a lot of magic happening.

import{Component}from'react'import{Comp,createBlock}from'classier-react'importlogofrom'./logo.svg'constAppContainer=createBlock(require('./App.css'))exportdefaultclassAppextendsComponent{render(){return(<AppContainerhover={{bg: 'blue'}}><AppContainer.Headerborder={['solid','black']}is="header"><Compas={AppContainer.Logo}><imgsrc={logo}alt="logo"/></Comp><AppContainer.Titleis="h1">Welcome to React</AppContainer.Title></AppContainer.Header><AppContainer.Introis="p">
To get started, edit <code>src/App.js</code> and save to reload.
</AppContainer.Intro></AppContainer>)}}

@d3dc
d3dcforce-pushed the master branch 2 times, most recently from 9f92a99 to 3b5928bCompareAugust 7, 2018 03:55
@d3dc

d3dc commented Aug 10, 2018

Copy link
Copy Markdown
OwnerAuthor

I've inadvertently gone and passed an object to createBlock here.

This is the object the proxy for unknown classes sits on top of.

You don't need a proxy when there is an object. The proxy is for the case when there is a string namespace to add. Can this just return a specialized Box or something instead of a proxy?

@d3dcd3dc closed this Aug 16, 2018
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@d3dc