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.

Can I have an example with create-react-app?

See original GitHub issue

Can I have an example with create-react-app?

I’ve tried to implement this lib within create-react-app project but it does not work. It seems my worker.js has something wrong.

image

component.js

 <WebWorker url="/worker.js">
    {({ data, error, postMessage }) => {
      if (error) return `Something went wrong: ${error.message}`
      if (data)
        return (
          <div>
            <strong>Received some data:</strong>
            <pre>{JSON.stringify(data, null, 2)}</pre>
          </div>
        )
      return <button onClick={() => postMessage('hello')}>Hello</button>
    }}
  </WebWorker>

https://codesandbox.io/s/ox85ooo31q

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
Lcj-spacecommented, Sep 7, 2020

Here’s a basic sandbox with CRA: https://codesandbox.io/s/bold-blackwell-vxxth The sandbox is 404’ing

1reaction
sometimescool22commented, Aug 30, 2019

@rainstormza @ghengeveld The sandbox is 404’ing, can we get an updated example?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create a New React App
Create React App is a comfortable environment for learning React, and is the best way to start building a new single-page application in...
Read more >
How to Build a React Project with Create React App in 10 Steps
To use Create React App, we first need to open our terminal or command line on our computer. To create a new React...
Read more >
Getting Started - Create React App
Get Started Immediately​ ... You don't need to install or configure tools like webpack or Babel. They are preconfigured and hidden so that...
Read more >
How To Set Up a React Project with Create React App
By the end of this tutorial, you'll have a running React application that you can use as a foundation for any future applications....
Read more >
Example of using React Cosmos with Create React App - GitHub
create -react-app is a global command-line utility that you use to create new projects. react-scripts is a development dependency in the generated projects...
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