Server side rendering with Riot.js: Passing opts.foo to this.foo in tag -


i having problems server side rending using riot.

in handler, pass foo object bar tag similar this:

reply(riot.render(bar, { foo: foo })); 

this copy of simple bar tag:

<bar>     <h1>test</h1>     <h1>{ foo }</h1>      this.foo = opts.foo     console.log(this.foo) </bar> 

when point browser relevant path, 'test' visible foo not. console.log(foo) works fine.

this worked me on similar setup

<bar>     <h1>test</h1>     <h1>{ opts.foo }</h1>     console.log(opts.foo) </bar> 

i believe works best bind directly data object instead of setting local variable


Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -