Skip to content
Advertisement

Getting data from react state function component

I have 2 function component , one have input and button and its passing data to states. Now i want to get state data from first function conlmponent to second component and display text to my div in second component. Is it possible to share states data from 1st component to 2nd component? The component are functions not classes

JavaScript

trying to get states in Articles from Input but it doesnt work

Advertisement

Answer

what you would like to do, is to put this two components inside a third one and have them share whatever states/data you want.

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement