lelandrichardson / react-primitives

Primitive React Interfaces Across Targets

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What about scrollview?

ahmedlhanafy opened this issue · comments

I feel like ScrollView is an essential part of these primitives, I can't remember any app that I built without it.

My initial reaction was like "naaaaah"... but after sleeping on it I think you are right @ahmedlhanafy! It's not really possible to create a ScrollView or PanView with the current primitives.

For web it's really just a plain view with style props set for overflow visibility. For React Native you can't just use a View unfortunately.

Some time ago I created an abstraction where you could do <View scrollable></View> where under the covers if that prop was present it would render a React Native ScrollView. I think that same pattern could be applied here.

For web it's really just a plain view with style props set for overflow visibility

It's more than that: https://github.com/necolas/react-native-web/tree/master/src/components/ScrollView

@necolas totally right. I have looked through all your source on the weekend. Didn't mean to trivialize. It's definitely not "just a view with styles" in order to have API compatibility. My bad... thanks for the correction.

I created better primitives with support TextInput and FlatList
Also, it's not use react-native-web package
So you can use latest react v16+ and react-native v0.48+
Take a look the repo https://github.com/dwicao/react-universal-rendering

see #54 for the discussion