I found a way to resolve the problem.
you should use componentWillReceiveProps, it will wait for the props to before rendering
componentWillReceiveProps(props: any) {
if (props.config.value !== "") {
//set here the sate
}
}