These are chat archives for SmartFocus/reactjs

4th
Mar 2015
Matt Bilbow
@mattbilbow
Mar 04 2015 09:25
hmm, where is your prop coming from?
Juho Vepsäläinen
@bebraw
Mar 04 2015 09:26
it's upper in the hierachy - basically the edit field at http://bebraw.github.io/reactabular/ (hit some name)
the problem is that if i use defaultValue, that inflicts state on my editor. -> if a page changes, it retains old data
basically i want it to receive the new data on page change. this is probably more fundamental problem, though
it would be just crazy to do this stuff in jquery :)
btw we're doing an isomorphic blogging engine on top of webpack+react. i put together a rough design doc, https://gist.github.com/bebraw/6a367f4487a72b9e7e8c
basics work but there's still a lot of refinement left in the implementation
Juho Vepsäläinen
@bebraw
Mar 04 2015 09:33
about the input issue - i could use a combination of value and onChange (track changes manually) + then flip internal state on render if the passed property changes
Matt Bilbow
@mattbilbow
Mar 04 2015 09:38
Still reading :)
Juho Vepsäläinen
@bebraw
Mar 04 2015 10:04
@mattbilbow i dropped the concept of widgets (redundant). plugins are just something that can shape the data in some way (inject properties etc.)
then you use React components to render based on the data blob
Salvador López Mendoza
@sallomendo
Mar 04 2015 18:54
How you manage api request on react? And wait for those to finish before you render the result? For server-side rendering
Juho Vepsäläinen
@bebraw
Mar 04 2015 19:17
@simiographics are you using some implementation of flux? that can simplify these things
@simiographics regardless of the approach i think the basic idea is that you render some js structure for react to pick up
Salvador López Mendoza
@sallomendo
Mar 04 2015 19:34
I'm using Fluxible
@bebraw Thats how I have it now, for example I have the route 'user/:userSlug', that route needs to make an API request the get the data before render, that way the server can respond a fullpage with all the date in it, instead of just send the structure and wait for componentDidMount, i will be loosing the benefits of server-side rendering like SEO
@bebraw I tried react-async and it works, but I don't like making api request in right in the component. :S
Juho Vepsäläinen
@bebraw
Mar 04 2015 19:38
i think fluxible should have pretty good examples
it is apparently one of those implementations that actually do this well. many suffer from singletons
that fluxible-plugin-fetchr thing sounds promising
have you tried that?
Salvador López Mendoza
@sallomendo
Mar 04 2015 19:41
No I haven't
Juho Vepsäläinen
@bebraw
Mar 04 2015 19:42
if i understood right, it does what you need with a nice api
Salvador López Mendoza
@sallomendo
Mar 04 2015 19:42
Need to tried to, right now I'm using the actionUtils they have, to get the inititial state of the app, but I guess I will nee to create a store like OmnipresentDataStore that check the current route and load specific state data