Rendering comma separated list of links

后端 未结 10 1650
再見小時候
再見小時候 2020-12-24 00:58

I\'m trying to output a list of comma separated links and this is my solution.

var Item = React.createComponent({
  render: function() {

    var tags = [],
         


        
10条回答
  •  不知归路
    2020-12-24 01:17

    To add to the great answers above Ramda has intersperse.

    To comma separate a bunch of items you could do:

    const makeLinks = (x: Result[]) =>
      intersperse(<>,, map(makeLink, x))
    

    Pretty succinct

提交回复
热议问题