Comments (5)
Seems to work! 👌
from react-nodegui.
i have a similar problem, when adding values to an array and using map to render Text elements, it doesnt get updated when adding or removing items, but it updates on next click(either adding or removing, but it stays one cycle behind), also updates if i click another button unrelated to the array..
this is my component (if the text on update button doesn't change it won't update)
const geometry = { x: 0, y: 100, width: 400, height: 600 };
function App() {
const [update, setUpdate] = useState(true);
const [textArr, setTextArr] = useState([]);
const addItem = () => {
const newText = Math.random()
.toString(36)
.substr(2, 5);
setTextArr([...textArr, newText]);
};
const removeItem = () => {
const newArr = Object.assign([], textArr);
newArr.shift();
setTextArr(newArr);
};
const updater = () => {
setUpdate(!update);
};
return (
<Window geometry={geometry} styleSheet={styleSheet}>
<View>
<Button
on={{ clicked: updater }}
text={update ? "update" : " update "}
/>
<Button on={{ clicked: addItem }} text="Add Item" />
<Button on={{ clicked: removeItem }} text="Remove Item" />
<Text>{"stringified: " + JSON.stringify(textArr)}</Text>
{textArr.map((txt) => (
<Text key={txt}>{"text: " + txt}</Text>
))}
</View>
</Window>
);
}
versions:
"@nodegui/nodegui": "^0.1.7",
"@nodegui/react-nodegui": "^0.1.6",
from react-nodegui.
This issue is now fixed in v0.1.9 of nodegui and react-nodegui
@pepf @slidinghotdog
Let me know if it fixes it after upgrading
from react-nodegui.
@master-atul its working great now, thanks!
from react-nodegui.
Awesome 🚀
from react-nodegui.
Related Issues (20)
- Bad URL Protocol C: when running on Windows.
- react nodegui call stack exceeded error when using GridView/ BoxView components HOT 5
- What should I use to manipulate audio in react nodegui? HOT 1
- Running for the second time no Macbook M1 HOT 3
- [Question] How do I use an SVG as an app background?
- It seems that react third-party component libraries are not supported HOT 1
- RNList and FlexLayout
- process dlopen: Cannot find symbol in flat namespace
- Can I create Intel windows binary on Apple Arm M1 machine ?
- libQt5Core.so.5: version `Qt_5.15' not found
- Cannot receive close event of FileDialog HOT 2
- Can I create submenus for System Tray Menu Actions?
- Is List component same as FlatList (efficient renderer)?
- Frameless window
- qmenubar.setCornerWidget
- Getting selected text in PlainTextEdit
- QTableWidget support
- This project is unmaintained
- Add windowGeometryChanged to QMainWindowSignals to track window changes. HOT 1
- was this project die?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-nodegui.