Any one have use fat free with react.js?

215 views
Skip to first unread message

Diluka Chamara

unread,
Dec 14, 2018, 9:57:47 PM12/14/18
to Fat-Free Framework
I decide to create fat free with react.js application. But I can.t think how to render the web page. Please tell me how to do it anyone who have experience for that?

ved

unread,
Dec 15, 2018, 10:58:02 AM12/15/18
to Fat-Free Framework
Hi,

Not really sure about what issue you're getting here but React is javascript and runs (usually) on the client, F3 is php and runs on the server. They're two completely separate things so nothing about F3 limits your use of React

I'd say that basically you just output your react code or script tags in your F3 views/layout or on a plain old regular index.html file.

Diluka Chamara

unread,
Dec 16, 2018, 7:34:57 AM12/16/18
to f3-fra...@googlegroups.com
Dear dev,

Is it better to do backend routing or frontend routing?

ved

unread,
Dec 16, 2018, 9:02:19 AM12/16/18
to Fat-Free Framework
Hi,

None is better, they're just different, React being client side and F3 being server side routing. It will depend on what or how you want it.

If you're using React just for simple components you may be able to do without React routing and just loading your react components through regular script tags that are loaded through your F3 routes.

Also, even if you use a more complex React app with routing, you'll probably also have to setup routing on F3 in order to use it as an API endpoint for React to fetch or post data using (for example) ReST or GraphQL.

So, for example, a /users/list route in React may do an GET request to F3 at /users in order to fetch all users from your backend.
Or a /users/create route on React may submit a POST request to F3 at /users in order to save the user to the database, etc.

Good luck.
Reply all
Reply to author
Forward
0 new messages