qrohlf / trianglify

Algorithmically generated triangle art
http://qrohlf.com/trianglify/
GNU General Public License v3.0
10.08k stars 669 forks source link

React Native support #71

Closed petermikitsh closed 7 years ago

petermikitsh commented 7 years ago

Probably taking a long shot here, but would anybody have an idea of what it would take to support this module in a React Native environment? I have used this module successfully in server-side node environments, and there are projects like rn-nodeify to make React Native act more like a server-side NodeJS environment by polyfilling some things.

I tried bringing this module into a React Native project and tried to use rn-nodeify and using jsdom to simulate the DOM, but to no avail. I ended up getting weird webpack errors. Wish I would've captured those errors to share here, but I have since backed that experiment out of my RN project and didn't stash it.

Alternatively, if anyone is aware of a similar module made for RN, I'd be open to using that. Thanks.

petermikitsh commented 7 years ago

For my use case, a static SVG was sufficient. So I used the trianglify generator, created the SVG that I wanted and modified it slightly so it would work with react-native-svg (which was as simple as camel casing props).

That's probably the best solution for people that want triangle meshes in React Native.