0.1.4 • Published 2 years ago

react-native-add-items-in-dev-menu v0.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

react-native-add-items-in-dev-menu

Package to add items in dev menu for toggle funcionalities

Installation

npm install react-native-add-items-in-dev-menu

Usage

import { useDevSettings } from "react-native-add-items-in-dev-menu";

// ...
const { loading, state } = useDevSettings([
    {name: "Title to show in dev menu"},
    {name: "Fixtures"},
    {name: "Clear AssyncStorage", action: async () => await AsyncStorage.clear()},
    {name: "Say hello", action: () => Alert.alert("Hello!")}
])
/*
    Value of the variable state:
    {"useTitleToShowInDevMenu": false, "useSayHello": false}
*/

// ...
const isShowTitle = state.useTitleToShowInDevMenu

if (loading) {
    return <View />
}

return (
    <View>
        <Text>{isShowTitle ? 'Title enabled' : 'Title disabled'}</Text>
        ...
    </View>
)

Example

readme in construction...

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago