I am trying to import chance js into my current native react project but it returns error.
solved
npm install chancethen in your app// Load Chancevar Chance = require('chance');// Instantiate Chance so it can be usedvar chance = new Chance();// Use Chance here.var my_random_string = chance.string();
Best Answer
import Chance from 'chance';const chance = new Chance();chance.string(); // "x(gAy#yo0^"
Using:
import Chance from 'chance';
-> !NB Chance
with a caps 'C'
then using chance
with a lowercase 'c'
works fine ...