Closed Return-1 closed 6 years ago
The dynamic demo is pretty hacky, I wouldn't rely on the patterns there.
As you noted, this is for SSR. onClick
is a client prop and doesn't end up in the generated JS. id
and your own JS is an option.
Otherwise, I'd recommend not using this project. Something like https://nextjs.org/ is probably what most people want today.
I am aware this lib is SSR and does not mount any js in the client.
Assuming i wanted to attach an onClick handler on part of my generated html. Right now what im doing is adding
id
s to my components and then through my js, attach listeners to them. Is there a better way? I would assume adding theonclick
property would also add it to the html but it seems to be stripped.What follows is not really an issue ( and somewhat related to the issue above), if there's a different place to post this do redirect me.
Even though this lib's purpose is to SSR im seeing this in the dynamic demo which employs setState and a custom onChange class method. Am i missing something? https://github.com/reactjs/express-react-views/blob/master/examples/dynamic/views/Content.js
Thanks a lot