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.

Multiple ink apps

See original GitHub issue

Hi,

I am trying to run one ink app, wait until it exits and then start another ink app. This doesn’t seem to work. Here is an example code:

import {Color, AppContext, render} from 'ink';
import React, {Component} from 'react'

class Elem extends Component{
  constructor(){
    super()
    setTimeout(() => {
      this.props.exit()
    }, 2000);
  }

  render(){
    return (<Color bold>{this.props.text}</Color>)
  }
}

const ElemApp = ({text})=>(
  <AppContext.Consumer>
    {({ exit }) => (
      <Elem text={text} exit={exit}/>
    )}
  </AppContext.Consumer>
)

async function start(){
  const app = render(<ElemApp text="App 1" />);
  await app.waitUntilExit()
  const app2 = render(<ElemApp text="App 2" />);
  await app2.waitUntilExit()
  console.log("finished")
}

start()

App 1 renders fine but App 2 never renders and directly jumps to finished line. Am I doing it wrong? Thanks

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
vadimdemedescommented, May 23, 2019

Thanks for a detailed bug report, guys! Issue should be fixed via https://github.com/vadimdemedes/ink/commit/6889f47e5c67210e780c357f0fbb51297a25f5e2.

@Jarred-Sumner @asadm would you be able to pull Ink’s master (npm install vadimdemedes/ink) and verify that it solved your problem? I will do a new release afterwards.

1reaction
vadimdemedescommented, May 20, 2019

I’ll take a look and reply back here, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Inks and Pens on the App Store
Inks and Pens is a natural media drawing app especially designed for iPad and the Apple Pencil. It reproduces the feelings of drawing...
Read more >
7 pen-friendly apps for Windows Ink - CNET
7 pen-friendly apps for Windows Ink · Maps · OneNote · FluidMath · Autodesk Sketchbook · Graphiter · Bamboo Paper · DocuSign ·...
Read more >
10 Great Pen-Enabled Apps That Work with Windows Ink
10 Great Pen-Enabled Apps That Work with Windows Ink · Fused · Plumbago · Sketchable · FluidMath · Drawboard PDF · StaffPad ·...
Read more >
Color Pick Pen - Scribble - Capture and Draw with 16 Million ...
The Scribble Ink Pen comes with three different sizes of drawing tip, ... The Scribble APPs let you capture, create and save as...
Read more >
12 Best Pen Friendly Apps for Windows Ink - Wpxbox
Best Pen Friendly Apps for Windows Ink · 1. Drawboard PDF · 2. Colour by Disney · 3. Sensavis Visual Learning Tool ·...
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