This app provides monitoring and information features for the common freifunk user and the technical stuff of a freifunk community.
Code base is taken from a TUM Practical Course project and added here to see if Freifunk Altdorf can use it.
https://www.freifunk-altdorf.de
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Bernhard Blieninger
fc05486403
|
6 years ago | |
---|---|---|
.. | ||
.npmignore | 6 years ago | |
LICENSE | 6 years ago | |
README.md | 6 years ago | |
cloneReferencedElement.js | 6 years ago | |
package.json | 6 years ago |
README.md
cloneReferencedElement for React
This is a version of React.cloneElement
that preserves the original element's ref even if you specify a new ref for the clone.
Installation
Install this module from npm:
npm install --save react-clone-referenced-element
This library was designed for React Native, so if you are using it with React in other environments, you will need to compile the code first. How you do this is up to you. With Babel, use the following plugins:
- es2015-block-scoping
- object-rest-spread
- trailing-function-commas
You will also need to transform or define a global variable named __DEV__
.
Usage
The signature of cloneReferencedElement
is the same as that of React.cloneElement
. However, when using callback refs, it will preserve the ref on the original component if there is one.
let element =
<Component ref={component => {
console.log('Running the original ref handler');
}} />
cloneReferencedElement(element, {
ref(component) {
console.log('Running the clone ref handler');
},
});
When the component is mounted, the console will display:
Running the clone ref handler
Running the original ref handler