Comment

Comment by jordrake

This is a nice library but state management libraries that rely on components in the render tree (function as a prop or children) mean you cannot access those properties in the immediate component's react lifecycle methods.

Instead you have to (sometimes arbitrarily) have a child component which takes in those properties. This child can then reference those properties in it's react lifecycle methods.

Fortunately this is a pretty simple problem to solve, you could introduce a higher order component which takes in your component and selectors much like redux. Infact, it seems the author beat me to it: https://twitter.com/aweary/status/1011478641320980480

parent jordrake 8 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton