jupyter-react A ReactJS component extension for Jupyter Notebooks
This repo actually has nothing to do with React, but rather is a base class meant for pairing up with JS based front-end UI components (see https://github.com/timbr-io/jupyter-react-js). The only thing in this module is a "Component" class. This class can be created with a "module" name that matches the name of a JS UI component and opens up a line of commuination called an "IPython Comm". Using the comm messages can be pased back and forth and property and actions can be taken as a result of UI interaction.
# Create a custom module in python
from jupyter_react import Component
class MyThing(Component):
module = 'AnyJSClassName'
comm_channel = 'custom.name'
def __init__(self, **kwargs):
super(MyThing, self).__init__(target_name='custom.name', **kwargs)
self.on_msg(self._handle_msg)
def _handle_msg(self, msg):
print msg
# In Jupyter / IPython instantiate the class and display it
from mything import MyThing
from IPython.display import display
mything = MyThing(props={})
display(mything)
Once a component is "displayed" a message is passed over the comm to the front-end. If the front-end has registered a handler for the same comm target\_name
then it will be called when the class is created. You can see more about how to build the front-end code here: https://github.com/timbr-io/jupyter-react-js.
@param props - dict of props to be passed to the front-end js when a comm is opened.
Called immediately when a class is instantiated, this method opens a comm to the front-end and passes the props to the JS.
Closes the comm.
@param data - dict of data to send over as a message comm
Sends a message over the comm.
@param callback - method to be called when a message is received over the comm
Author: timbr-io
Source Code: https://github.com/timbr-io/jupyter-react
Article covers: How native is react native?, React Native vs (Ionic, Cordova), Similarities and difference between React Native and Native App Development.
Increase Performance of React Applications Via Array JavaScript Methods. We will create a simple event management application in the react to add, update, and delete an event.
I have been using React JS in my projects for quite some time now and am used to managing routing in my app using the react-router package. I have always been keen on having as little dependencies in my apps as possible, so, I always felt perturbed by the use of this particular package in simpler apps which did not have complex routes.
In this post, I will share my own point of view about React Hooks, and as the title of this post implies, I am not a big fan.
This article will walk you through the concepts you would need to know to step into the world of widely used ReactJS.