The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

422632 (2) [Avatar] Offline
#1
It's not a huge deal, but when you copy the code from the liveBook, many of the quotes are smart quotes and cause an error when you run the program. For example, see line 11 below from chapter 2.

class MainComponent extends Component {
  constructor() {
    super()
    this.state = { loading: true, data: {} }
  }
  componentDidMount() {
    // simulate ajax call
    setTimeout(() => {
      this.setState({
        loading: false,
        data: {name: ‘Nader Dabit’, age: 35}
      })
    }, 2000)
  }
  render() {
    if(this.state.loading) {
      return <Text>Loading</Text>
    }
    const { name, age } = this.state.data
    return (
      <View>
        <Text>Name: {name}</Text>
        <Text>Age: {age}</Text>
      </View>
    )
  }
}
Marina Michaels (46) [Avatar] Offline
#2
Thank you for reporting this. I've passed this information on to one of the people working on liveBooks.

Meanwhile, can you access the author's repo and get the code from there?
422632 (2) [Avatar] Offline
#3
I just corrected the quotes. It wasn't a huge problem.
baronnoraz (13) [Avatar] Offline
#4
FYI - prior to publication - an effort was made to go back through all of the code examples and fix the smart quotes. If you find places that were missed, please let us know, so that we can get them fixed in future editions.

I personally find it massively annoying to not be able to copy and paste the code. I personally fixed a bunch of that in the code smilie

The book has finally gone to print and will be available in April.