question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

support react hook about sdk.js?

See original GitHub issue

Hi, I am using next.js and react hook and sdk.js the sdk url is https://static.line-scdn.net/liff/edge/2/sdk.js

I have a error when passing query string to Liff v2, ex: https://liff.line.me/1654356111-zzzzzzzz?userId=aaa, But if I don’t pass query string then no error.

code example:

useEffect(() => {
        initializeLiff('a real id')
    })

function initializeLiff(myLiffId) {
        liff
            .init({
                liffId: myLiffId
            })
            .then(() => {
                // start to use LIFF's api
                console.log('initializeLiff ok')
            })
            .catch((err) => {
                console.log(err.code, err.message);
            });
    }


return (
        <React.Fragment>
            <Head>
                <script charSet="utf-8" src="https://static.line-scdn.net/liff/edge/2/sdk.js"></script>
            </Head>
        </React.Fragment>
)

I would appreciate your help.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
smwilkcommented, Aug 7, 2020

Hi @natehsu, Thank you for your question, and I’m very sorry about the lack of response. Could you please share the error message you are seeing?

0reactions
natehsucommented, Aug 31, 2020

@smwilk Thank you for the information.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hooks API Reference - React
Hooks are a new addition in React 16.8. They let you use state and other React features without writing a class. This page...
Read more >
Getting Started With The React Hooks API - Smashing Magazine
React Hooks are in-built functions that allow React developers to use state and lifecycle methods inside functional components, they also work ...
Read more >
React hooks - Optimizely
The React SDK provides the following React hooks: Retrieve the status of a feature flag and its variables. This can be useful as...
Read more >
How To Call Web APIs with the useEffect Hook in React
In this step, you set up a service to retrieve data from an API. You learned how to call the service using the...
Read more >
Hooks - React Redux
Hooks · We recommend using the React-Redux hooks API as the default approach in your React components. · The selector function should be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found