
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
@cycle/react-native
Advanced tools
Cycle.js driver that uses React Native to render
makeReactNativeDriverView(), Text(), etcnpm install @cycle/react-native
import xs from 'xstream';
import {run} from '@cycle/run';
import {makeReactNativeDriver, TouchableOpacity, View, Text} from '@cycle/react-native';
function main(sources) {
const inc = Symbol();
const inc$ = sources.react.select(inc).events('click');
const count$ = inc$.fold(count => count + 1, 0);
const elem$ = count$.map(i =>
TouchableOpacity(inc, [
View([
Text(`Counter: ${i}`),
])
]),
);
return {
react: elem$,
};
}
run(main, {
react: makeReactNativeDriver('MyApp'),
});
Start by installing React Native prerequisites (XCode, react-native-cli, watchman).
Then create a React Native project using the CLI.
When the project is set up, npm install @cycle/react-native, @cycle/run, and a stream library like xstream, then replace the index.js with something that looks like the example code in this readme.
makeReactNativeDriver(appKey)Returns a driver that uses React Native to render your Cycle.js app in the native application known by the string appKey.
Import hyperscript helpers such as View, Text, TouchableOpacity, etc to create React elements to represent the respective built-in native components: <View>, <Text>, <TouchableOpacity>, etc.
The basic usage is View(props, children), but some variations and shortcuts are allowed:
View() becomes <View/>View(props) becomes <View {...props}></View>Text('text content') becomes <Text>text content</Text>View([child1, child2])Text(props, 'text content')View(props, [child1, child2])There are also shortcuts for (MVI) intent selectors:
Touchable(someSymbol) becomes h(Touchable, {sel: someSymbol})Touchable(sym, props) becomes h(Touchable, {sel: sym, ...props})Text('myselector', 'text content')Touchable('inc', [child])Touchable('inc', propsObject, [child])For non-built-in components (e.g. third party) components, you can use h(ThirdPartyComponent) with h from @cycle/react or you can build a helper using makeHelper(ThirdPartyComponent) with makeHelper from @cycle/react-native.
This library only covers React components in React Native and View-related rendering. For other native APIs in React Native, use drivers specifically built for those. See the list below:
MIT, Andre 'Staltz' Medeiros 2018
FAQs
Cycle.js driver that uses React Native to render
The npm package @cycle/react-native receives a total of 6 weekly downloads. As such, @cycle/react-native popularity was classified as not popular.
We found that @cycle/react-native demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.