Kozea / formol

An opinionated react form framework.
MIT License
190 stars 17 forks source link

create-react-app compatibility #45

Closed PabloSzx closed 5 years ago

PabloSzx commented 5 years ago

How can I do the webpack rules if I'm using https://github.com/facebook/create-react-app

paradoxxxzero commented 5 years ago

I don't think CRA allows you to change the webpack config. There are several projects that try to workaround this, you can try craco, react-app-rewired, rescripts.

PabloSzx commented 5 years ago

I understand that fact, but by this issue i mean, there is no direct compatibility for CRA then?

pkalisiewicz commented 5 years ago

If there is no option to add it to the create-react-app, is there any starter project with pre-configured webpack which we can use to play around, apart of the storybook demo?

paradoxxxzero commented 5 years ago

Here you go https://github.com/Kozea/formol_starter_pack

pkalisiewicz commented 5 years ago

It is actually possible to attach it to the create-react-app. Instead of importing

import Formol, { Field } from 'formol';

you need to import a precompiled version, and install date-fns

yarn add date-fns
import Formol, { Field } from 'formol/lib/formol';
paradoxxxzero commented 5 years ago

formol use date-fns 2 (which is still not stable...), so you want to:

yarn add date-fns@next
trujic1000 commented 5 years ago

I started project with CRA and used react-app-rewired to configure webpack and be able to use formol.

https://github.com/trujic1000/formol-starter-pack