Comments (6)
Thermite doesn't do much with props
, only state. Right now, you can read props
in render, or convert to a React component spec, and do stuff with the props
there before finally converting to a component class.
The tricky thing is that props
aren't as nicely composable as the state from Thermite's point of view, in the sense that the parent is responsible for updating props
, not the current component. On the other hand, we can share parts of state between parent and child easily.
from purescript-thermite.
Yes, I see that I could manage it through state, but React itself is moving more and more away from the concept of stateful components, and the current version even introduces a new syntax:
var Aquarium = (props) => {
var fish = getFish(props.species);
return <Tank>{fish}</Tank>;
};
which is actually a function from props to component, so I thought that maybe there is a way to embrace props rather than fighting them...
The fact that the parent is responsible for providing props and not the current component corresponds to the fact that the caller is responsible for providing function arguments and not the function itself. Not sure if it should be a problem for composition.
from purescript-thermite.
This is probably relevant: purescript-contrib/purescript-react#52
from purescript-thermite.
Oh, thank you! I will definitely check it out. Does it still work with the latest purescript-thermite
?
from purescript-thermite.
Yes, I've updated Thermite to use the latest version.
from purescript-thermite.
Thanks a lot! I'll close this issue and give it a go.
from purescript-thermite.
Related Issues (20)
- Uprade to PS 0.12 ? HOT 6
- README: defaultMain params seem incorrect HOT 2
- What is R.p' in the Getting Started Documentation? HOT 2
- Thermite example doesnt seem to work HOT 1
- Can't run the example HOT 3
- Add subscriptions and initialAction
- Multiple 'update' actions work on initial copy HOT 3
- Can't get any examples working HOT 7
- Missing hello world / template? HOT 6
- Two state updates (cotransforms) in one performAction HOT 4
- Use of div' in render causes problems with react-native HOT 14
- Any plans to add JSX support!? HOT 1
- Asynchronous handlers closing over state? HOT 1
- Monolithic components HOT 1
- Routing and actions/effects while switching views HOT 2
- Server Side Rendering in Thermite HOT 5
- ReactDOM failed to load HOT 3
- example project demo link in README.md is broken HOT 1
- `createReactSpec` type too restrictive. HOT 4
- Remove DOM dependency HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from purescript-thermite.