Skip to content

"Invalid hook call" error #42

Description

@ycdaskin

When i try to run very basic example given in the readme doc, i am facing invalid hook call error.

My code is:

import { useEffect } from "react";
import { Text, View } from "react-native";
import { useTwitter } from "react-native-simple-twitter";

const TwitterSignin = () => {
    
    const { twitter, TWModal, loggedInUser, accessToken } = useTwitter({
        consumerKey: "my key",
        consumerSecret: "my secret",
    });

    const onLoginPress = async () => {
        try {
            await twitter.login();
        } catch (e) {
            console.log(e.errors);
        }
    }
    

    useEffect(() => {
        console.log(loggedInUser)
    }, [loggedInUser, accessToken]);

    return (
        <View>
            <Text onPress={onLoginPress}>login</Text>
            <TWModal />
        </View>
    )
}

export default TwitterSignin

image

react native version: 0.71.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions