preact-jsx-chai icon indicating copy to clipboard operation
preact-jsx-chai copied to clipboard

setState

Open 1rosehip opened this issue 8 years ago • 1 comments

Hello, Is it possible to check state changes or call setState function with the lib?

Thanks

1rosehip avatar Feb 06 '18 09:02 1rosehip

@1rosehip It is not possible as far as I can tell. As you can see in the code snippet here, classful (i.e. stateful) components a created anew on each render and are not preserved in any manner, do not support an interface for updating state, not are they returned so that you can interrogate the classes after they are rendered.

https://github.com/developit/preact-render-to-string/blob/ef7b0a260f3bf834a7deaf4cb5e8016610c57ed4/src/index.js#L70-L78

billneff79 avatar Nov 26 '18 22:11 billneff79