Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upcreate-react-app + forgJS #75
Comments
Hello, i haven't tried it but you should try |
No it doesn’t |
this worked for me can you give me more information i dont get the problem that you got |
Are you sure you tried on ‘npx create-react-library’ I realised on the title I put the CRA that is the wrong one |
can you tell me the steps you went thought i did: i didn't get any problem |
1- import * as React from 'react';
import {Rule} from '@cesium133/forgjs';
import styles from './styles.css';
const ExampleComponent = ({ text }: any) => {
const floatRule = new Rule(
{
type: 'float',
min: 100,
},
null
);
const result = floatRule.test(200.3);
console.log(result);
return <div className={styles.test}>Example Component: {text}</div>;
};
export default ExampleComponent; 8- Error: [!] Error: 'Rule' is not exported by node_modules/@cesium133/forgjs/index.js
https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module
src/index.tsx (2:9)
1: import * as React from 'react';
2: import { Rule } from '@cesium133/forgjs';
^
3: import styles from './styles.css'; The folder you edit is the demo folder that is the project that run your library |
Apparently imports dont work with type script you can use require it worked for me try this and tell me if you get errors: |
Unfortunately is not correct! Import works really well with typescript. I tried to use it in a CRA create-react-app newtest —typescript. |
Did the require work for you ? |
It create a circular recoursion on the demo. However I don’t think require is the best solution |
Id keep looking. Please tell me if you find a fix for this |
Hi there,
I'm trying to use forgJS with create-react-app but unfortunately it raise the error:
this is how I used:
To have a working example is enough to do:
npx create-react-library
and then install the package forgJs.
Can someone help me on that please?