These are chat archives for chandu0101/scalajs-react-components

19th
Oct 2015
virtualirfan
@virtualirfan
Oct 19 2015 00:53

@chandu0101 from the doc you sent

but Sri comes with some basic building blocks: View, Text, TextInput, Image, Touchable*, ScrollView that are high level components built based on div, span, input, img, button ... I believe these primitives covers more than 80% use cases in our web apps

What do you see as the best way to use sri then, basically build on native components?

For example, what would one do for visualizations done via D3?
Chandra Sekhar Kode
@chandu0101
Oct 19 2015 02:19

What do you see as the best way to use sri then, basically build on native components?

for regular web apps yes! , btw they’re just reusable react componenst like any other reusable UI kits out there(material-ui belly)

For example, what would one do for visualizations done via D3?

I have no experience with D3/visualization , it looks like you need svg primitive elements right , may be you can try something similar below

// define primitives you need for your project 
val svg = React.createFactory(“svg”)

//use them in render methods

def render() = {
   val props = json(className=“x”,width = “23 px”)   
   svg(props,children)
}

create resuable components like any UI kit so that you don’t need touch primitives again or use existing react-d3 implementation out there