[GH-ISSUE #200] will proton support hooks? #133

Closed
opened 2026-05-05 11:46:50 -06:00 by gitea-mirror · 6 comments
Owner

Originally created by @joshuarossi on GitHub (Feb 9, 2019).
Original GitHub issue: https://github.com/kusti8/proton-native/issues/200

Originally created by @joshuarossi on GitHub (Feb 9, 2019). Original GitHub issue: https://github.com/kusti8/proton-native/issues/200
Author
Owner

@aviaryan commented on GitHub (Feb 10, 2019):

Would absolutely love to use the latest React version with Proton-Native. Btw, can't we use the manual install way of proton-native, use latest react and enjoy hooks? https://proton-native.js.org/#/manual_install

<!-- gh-comment-id:462107193 --> @aviaryan commented on GitHub (Feb 10, 2019): Would absolutely love to use the latest React version with Proton-Native. Btw, can't we use the manual install way of proton-native, use latest react and enjoy hooks? https://proton-native.js.org/#/manual_install
Author
Owner

@kusti8 commented on GitHub (Feb 10, 2019):

It seems that react-reconciler also needs to be updated to support this. I'll see if I can update it and if that works.

<!-- gh-comment-id:462141162 --> @kusti8 commented on GitHub (Feb 10, 2019): It seems that react-reconciler also needs to be updated to support this. I'll see if I can update it and if that works.
Author
Owner

@v1rtl commented on GitHub (Mar 26, 2020):

@kusti8 is it possible to update the reconciler in the near future? I don't want to write classes :/

<!-- gh-comment-id:604433471 --> @v1rtl commented on GitHub (Mar 26, 2020): @kusti8 is it possible to update the reconciler in the near future? I don't want to write classes :/
Author
Owner

@kusti8 commented on GitHub (Mar 26, 2020):

It has been updated and hooks work.

<!-- gh-comment-id:604438253 --> @kusti8 commented on GitHub (Mar 26, 2020): It has been updated and hooks work.
Author
Owner

@v1rtl commented on GitHub (Mar 26, 2020):

@kusti8 I tried to make a button that increments counter, but it remains 0, should I open an issue?

here's the code:

import React, { useState } from 'react' // import from react

import { Window, App, Button, Text } from 'proton-native' // import the proton-native components

const Example = () => {
  const [counter, count] = useState(0)

  return (
    <App>
      <Window style={{ width: 300, height: 300, backgroundColor: 'red' }}>
        <Text>{counter}</Text>
        <Button title="+1" onClick={() => count(c => c + 1)} />
      </Window>
    </App>
  )
}

export default Example

wtf2

<!-- gh-comment-id:604642299 --> @v1rtl commented on GitHub (Mar 26, 2020): @kusti8 I tried to make a button that increments counter, but it remains 0, should I open an issue? here's the code: ```jsx import React, { useState } from 'react' // import from react import { Window, App, Button, Text } from 'proton-native' // import the proton-native components const Example = () => { const [counter, count] = useState(0) return ( <App> <Window style={{ width: 300, height: 300, backgroundColor: 'red' }}> <Text>{counter}</Text> <Button title="+1" onClick={() => count(c => c + 1)} /> </Window> </App> ) } export default Example ``` ![wtf2](https://user-images.githubusercontent.com/35937217/77689126-34dd4680-6fb2-11ea-9190-642567e85c69.gif)
Author
Owner

@sergiodanilo commented on GitHub (Apr 19, 2020):

Change onClick to onPress

<!-- gh-comment-id:616167941 --> @sergiodanilo commented on GitHub (Apr 19, 2020): Change `onClick` to `onPress`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/proton-native#133
No description provided.