-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
create-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?
The text was updated successfully, but these errors were encountered: