Closed aleemb closed 7 years ago
Not everyone uses react. Why should this be part of the framework, and not a separate package?
do check #525
@sisve I suppose the same as the reason for VueJS (though I understand VueJS is partnered with Laravel which makes it easier). However, React has a much larger community and so it would benefit both Laravel and React ecosystems as a whole.
React support is already there, this would extend the presets to improve the UX/DX to modular development as opposed to the current, all or nothing.
One important thing to keep in mind is the licensing. We must make sure that any implementation provided does not enforce the react patents license upon Laravel users.
Thank you for your suggestion, but looks like not enough members are interested in such change so I'm going to close this issue.
Description:
The great thing about Vue is that it you can integrate it progressively, unlike React which is all or nothing.
It would be great to allow converting just a single page of the Laravel app over to React while keeping the rest the same. Or integrate a React component into an existing page without moving toward SPA or converting that entire page into a JS component just to be able to include a single React component.
This requires some plumbing but is achievable and can up the ante for React developers.
Maybe a blade directive
@react('MyComponent', [$arg1, $arg2, ...])
which would generate the proper HTML withdata-*
tags into which React would render the component. Thereact
andreact-dom
libs would need to be loaded separately as external dependencies so they aren't bundled with each component.