Closed wilkerlucio closed 6 years ago
you're right I believe this isnt possible currently. Ill work something out in the next release. we can either have an extra prop on the Text component which overrides the children prop if defined or we can have optional Function as Child Component. Eg:
<Text>{(props) => props.datum.id}</Text>
Which do you think is better?
or we can move away from having children at all and just use a specific custom prop for the text value, eg: <Text value="lorem" />
I like the value
prop approach, most of the texts are just a print operation. The one on children sounds interesting, but at same I'm not sure how you would handle that, is it easy to parse functions inside of children?
yeah I guess its more simple having a value prop
@wilkerlucio the library has been completely rewritten (and renamed) and has a much simpler API now as a result of switching to a render props approach. It would be great to get feedback on it if you have any. The new docs can be found here: http://numberpicture.com/build
Hello, I'm trying to figure how to print text from data, this is how I'm trying to do it:
I saw in the docs I need to send the text as children, but how to get it from the datum?