I am browsing the reactfire github and they use mixins.
I thought they were deprecated? Am I behind the times?
You might want to take a look to this brief answer: https://www.quora.com/Is-it-possible-to-use-Firebase-with-ES6-on-React
The problem with ReactFire is because it uses Mixins, it's not compatible with ES6 classes. After chatting with Jacob Turner, we wanted to create a way to allow the one way binding of ReactFire with ES6 classes along some more features like two way data binding and listening to Firebase endpoints without actually binding a state property to them. Thus, re-base was built.
So, here's a Relay inspired library for building React.js + Firebase applications: https://github.com/tylermcginnis/re-base
This was helpful to me, I hope it'll be the same with you.
Apart from re-base, also have a look at react-redux-firebase as mentioned in this reactfire discussion:
react-redux-firebase
Redux bindings for Firebase. Includes Higher Order Component for use with React.
http://react-redux-firebase.com
https://github.com/prescottprue/react-redux-firebase
Related
I would like to know if it is possible to create a React project containing Redux library and then export it in another project? Until now, I only create components that display data. So I never wonder if it is possible.
The goal is to develop a little chatbot that communicates with an API. Then, this project will be used in several React projects.
Is it possible to do this? If yes, is it a good practice?
I have searched on the web and on Stack Overflowbut I didn't find any answer.
Sorry if the question has already been asked.
Thanks.
It is possible. A React component is a JavaScript function or a class. It can contain any JavaScript code. So a companent that is exported to other projects can manage its state using Redux.
Redux makes sense when the state handling is complex. Your component seems simple since all it does send data to an API and show received data. If you think it is complicated and that it would be difficult to implement it using pure React alone, you can use Redux.
I'm new to react js and am learning it as part of OJT. Please excuse going forward if i end up using few terms incorrectly.
I'm trying to override few methods of our core module related to logging.
However, in react js overriding is only limited to React.Component classes it seems.
i looked up few posts associated with overriding the methods as per our requirement
is there a way to override normal classes in react js? does ES6 support such a scenario and if so, is it recommended to make it work like java.
The plug-in documentation states:
When adding functionality to Griddle, you’ll likely need to response to actions and update the application state. This can easily be done by adding action handling functions to your reducer object.
I am writing a plug-in to replace the default Pagination with bootstrap styled Pagination. This will need access to getNext() getPrevious() and setPage() in actions. I can clearly see how to access these from inside the Griddle package as the local plug-in does.
I am unsure how I would access these functions and state from a plug-in written in my application.
What do I need to import from Griddle? What do I need to call?
Found it. In the Story Book, the custom page size settings story accesses the selectors and actions exports to give a plugin more direct access to the internals. The other stories around it do a fair job of demonstrating how to access Griddle internals from the a plugin.
Note that in addition to directly accessing the exported selectors and actions, both are available through React Context as well, e.g. in LocalPlugin.components.TableBodyContainer. Context should expose the "best" selectors/actions for the current <Griddle /> after plugins have been applied.
Some work was started in https://github.com/GriddleGriddle/Griddle/pull/743 to make selectors more composable, but the PR has gone stale.
I would like to know if it is possible to create a React project containing Redux library and then export it in another project? Until now, I only create components that display data. So I never wonder if it is possible.
The goal is to develop a little chatbot that communicates with an API. Then, this project will be used in several React projects.
Is it possible to do this? If yes, is it a good practice?
I have searched on the web and on Stack Overflowbut I didn't find any answer.
Sorry if the question has already been asked.
Thanks.
It is possible. A React component is a JavaScript function or a class. It can contain any JavaScript code. So a companent that is exported to other projects can manage its state using Redux.
Redux makes sense when the state handling is complex. Your component seems simple since all it does send data to an API and show received data. If you think it is complicated and that it would be difficult to implement it using pure React alone, you can use Redux.
Reference MV* Architecture using React js
I understand that React is an View Engine and it still requires many other libraries like Redux..etc.
Is there a list of libraries to be used along with React to build a complete ecosystem like Angular ?
The React/JS ecosystem has become so rich, you can't really decide of a set of libraries to use by default in every projects.
It really depends on your needs.
Many people choose to generally go with react-router for the client-side routing, react-dom to interact with the DOM, redux for the state management, and react-redux to connect your components to the redux state.
You might find better answers by looking at the code of these react boilerplates, some of them explain there choices: http://andrewhfarmer.com/starter-project/
One of the key decisions in choosing React over Angular for us was that React is a technology, not a framework.
The ability to mix librairies to your needs is the big plus; there is no best list. As a quick example, redux makes tons of sense for us for the webapps, however it does not for the react-native mobile app where it may not blend well with the Navigator or may be overkill...