4 ms·
I like to think of React components as interfaces. I'm saying that this component is capable of handling these actions, and displaying these things. On differen
by rezistik 12y ago
I like to think of React components as interfaces. I'm saying that this component is capable of handling these actions, and displaying these things. On different platforms the exact behavior is expected to change, but I can trust that my UserStatus component always accepts a users status property, always displays it and perhaps manages modifying it. I can trust that my LogCard component will always be a container for a log using the same actions.
In that way I'm free to modify the implementation of the component to match the platform and can still share the component across platforms.
The React team has already stated they aren't attempting to Write-Once-Run-Anywhere, they are establishing patterns for learning once write anywhere.